Package trac :: Module perm :: Class PermissionSystem

Class PermissionSystem

source code

    object --+    
             |    
core.Component --+
                 |
                PermissionSystem

Permission management sub-system.
Nested Classes

Inherited from core.Component: __metaclass__

Instance Methods
 
__init__(self)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
grant_permission(self, username, action)
Grant the user with the given name permission to perform to specified action.
source code
 
revoke_permission(self, username, action)
Revokes the permission of the specified user to perform an action.
source code
 
get_actions_dict(self, skip=None)
Get all actions from permission requestors as a dict.
source code
 
get_actions(self, skip=None)
Get a list of all actions defined by permission requestors.
source code
 
get_user_permissions(self, username=None)
Return the permissions of the specified user.
source code
 
get_all_permissions(self)
Return all permissions for all users.
source code
 
get_users_with_permission(self, permission)
Return all users that have the specified permission.
source code
 
expand_actions(self, actions)
Helper method for expanding all meta actions.
source code
 
check_permission(self, action, username=None, resource=None, perm=None)
Return True if permission to perform action for the given resource is allowed.
source code
 
get_permission_actions(self)
Implement the global TRAC_ADMIN meta permission.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Static Methods

Inherited from core.Component: implements

Class Variables
  required = True
  store = <ExtensionOption [trac] "permission_store">
  policies = <OrderedExtensionsOption [trac] "permission_policies">
  CACHE_EXPIRY = 5
  CACHE_REAP_TIME = 60
Properties
  requestors
List of components that implement ~trac.perm.IPermissionRequestor

Inherited from object: __class__

Method Details

__init__(self)
(Constructor)

source code 
x.__init__(...) initializes x; see help(type(x)) for signature
Overrides: object.__init__
(inherited documentation)

get_actions_dict(self, skip=None)

source code 

Get all actions from permission requestors as a dict.

The keys are the action names. The values are the additional actions granted by each action. For simple actions, this is an empty list. For meta actions, this is the list of actions covered by the action.

get_user_permissions(self, username=None)

source code 

Return the permissions of the specified user.

The return value is a dictionary containing all the actions granted to the user mapped to True. If an action is missing as a key, or has False as a value, permission is denied.

get_all_permissions(self)

source code 

Return all permissions for all users.

The permissions are returned as a list of (subject, action) formatted tuples.

get_users_with_permission(self, permission)

source code 

Return all users that have the specified permission.

Users are returned as a list of user names.

get_permission_actions(self)

source code 

Implement the global TRAC_ADMIN meta permission.

Implements also the EMAIL_VIEW permission which allows for showing email addresses even if [trac] show_email_addresses is false.


Property Details

requestors

List of components that implement ~trac.perm.IPermissionRequestor
Get Method:
unreachable.extensions(component) - Return a list of components that declare to implement the extension point interface.