Commit 6b1e9548 by Őry Máté

vm: use circle.acl instead of guardian

parent 666e2ede
...@@ -15,7 +15,7 @@ from netaddr import EUI, mac_unix ...@@ -15,7 +15,7 @@ from netaddr import EUI, mac_unix
from .tasks import local_tasks, vm_tasks, net_tasks from .tasks import local_tasks, vm_tasks, net_tasks
from firewall.models import Vlan, Host from firewall.models import Vlan, Host
from storage.models import Disk from storage.models import Disk
from acl.models import AclBase
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
pwgen = User.objects.make_random_password pwgen = User.objects.make_random_password
...@@ -256,7 +256,7 @@ class InterfaceTemplate(Model): ...@@ -256,7 +256,7 @@ class InterfaceTemplate(Model):
verbose_name_plural = _('interface templates') verbose_name_plural = _('interface templates')
class Instance(BaseResourceConfigModel, TimeStampedModel): class Instance(AclBase, BaseResourceConfigModel, TimeStampedModel):
"""Virtual machine instance. """Virtual machine instance.
...@@ -282,6 +282,11 @@ class Instance(BaseResourceConfigModel, TimeStampedModel): ...@@ -282,6 +282,11 @@ class Instance(BaseResourceConfigModel, TimeStampedModel):
('SHUTOFF', _('shutoff')), ('SHUTOFF', _('shutoff')),
('CRASHED', _('crashed')), ('CRASHED', _('crashed')),
('PMSUSPENDED', _('pmsuspended'))] # libvirt domain states ('PMSUSPENDED', _('pmsuspended'))] # libvirt domain states
ACL_LEVELS = (
('user', _('user')), # see all details
('operator', _('operator')), # console, networking, change state
('owner', _('owner')), # superuser, can delete, delegate perms
)
name = CharField(blank=True, max_length=100, verbose_name=_('name'), name = CharField(blank=True, max_length=100, verbose_name=_('name'),
help_text=_('Human readable name of instance.')) help_text=_('Human readable name of instance.'))
description = TextField(blank=True, verbose_name=_('description')) description = TextField(blank=True, verbose_name=_('description'))
...@@ -321,11 +326,6 @@ class Instance(BaseResourceConfigModel, TimeStampedModel): ...@@ -321,11 +326,6 @@ class Instance(BaseResourceConfigModel, TimeStampedModel):
class Meta: class Meta:
ordering = ['pk', ] ordering = ['pk', ]
permissions = (
('own_instance', _('owner')), # superuser, can delete, delegate perms
('operate_instance', _('operator')), # console, networking, change state
('use_instance', _('user')), # see all details
)
verbose_name = _('instance') verbose_name = _('instance')
verbose_name_plural = _('instances') verbose_name_plural = _('instances')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment