noc.aaa.models.permission

Module Contents

noc.aaa.models.permission.perm_lock
noc.aaa.models.permission.id_lock
class noc.aaa.models.permission.Permission

Bases: noc.core.model.base.NOCModel

Permissions.

Populated by manage.py sync-perm @todo: Check name format

class Meta

Bases: object

verbose_name = Permission
verbose_name_plural = Permissions
db_table = main_permission
app_label = aaa
name
implied
users
groups
_id_cache
_name_cache
_effective_perm_cache
__str__(self)
classmethod get_by_id(cls, id)
classmethod get_by_name(cls, name)
get_implied_permissions(self)
classmethod has_perm(cls, user, perm)

Check user has permission either directly either via groups

classmethod get_user_permissions(cls, user)

Return a set of user permissions

classmethod set_user_permissions(cls, user, perms)

Set user permissions

Parameters:
  • user (User) – User
  • perms (Set) – Set of new permissions
classmethod get_group_permissions(cls, group)

Get set of group permissions

classmethod set_group_permissions(cls, group, perms)

Set group permissions

Parameters:
  • group (Group) – Group
  • perms (Set) – Set of permissions
classmethod get_effective_permissions(cls, user)

Returns a set of effective user permissions, counting group and implied ones

classmethod sync(cls)