noc.lib.app.access

Module Contents

exception noc.lib.app.access.PermissionDenied

Bases: exceptions.Exception

Basic Permission Denied exception

class noc.lib.app.access.Permission

Bases: object

Basic Permission class. Each permission must implement check method and optional queryset method

queryset(self, request)

Get _Q_ object restricting the list of available objects

check(self, app, user, obj=None)

Called to check wrether user has access For granular permissions obj=None means check user has application access

display(self, user)

Return human-readable representation of permission set Applicable only for granular permissions

__or__(self, r)

_or_ operator implementation

__and__(self, r)

_and_ operator implementation

class noc.lib.app.access.LogicPermision(left, right)

Bases: noc.lib.app.access.Permission

Boolean logic permission. Used to combine two permissions using logic condition

class noc.lib.app.access.ORPermission

Bases: noc.lib.app.access.LogicPermision

_or_ combination. Permit if either left or right conditions are met

check(self, app, user, obj=None)
queryset(self, request)
class noc.lib.app.access.ANDPermission

Bases: noc.lib.app.access.LogicPermision

_and_ combination. Permit if both left and right conditions are met

check(self, app, user, obj=None)
queryset(self, request)
class noc.lib.app.access.Permit

Bases: noc.lib.app.access.Permission

Always permit

check(self, app, user, obj=None)
class noc.lib.app.access.Deny

Bases: noc.lib.app.access.Permission

Always deny

check(self, app, user, obj=None)
class noc.lib.app.access.PermitLogged

Bases: noc.lib.app.access.Permission

Permit any authenticated user

check(self, app, user, obj=None)
class noc.lib.app.access.PermitSuperuser

Bases: noc.lib.app.access.Permission

Permit superusers

check(self, app, user, obj=None)
class noc.lib.app.access.HasPerm(perm)

Bases: noc.lib.app.access.Permission

Permit if the user has permission _perm_

__repr__(self)
get_permission(self, app)
check(self, app, user, obj=None)