wCMF  3.6
 All Classes Namespaces Files Functions Variables Groups Pages
RightsManager Class Reference

Public Member Functions

getInstance ()
 
 getAuthUserVarname ()
 
getAuthUser ()
 
 isAnonymous ()
 
 deactivate ()
 
 activate ()
 
 authorize ($resource, $context, $action)
 
 getRight ($config, $resource, $context, $action)
 
 createPermission ($config, $resource, $context, $action, $role, $modifier)
 
 removePermission ($config, $resource, $context, $action, $role)
 
 modifyRight ($config, $resource, $context, $action, $role, $modifier)
 

Public Attributes

 $_anonymousUser = null
 

Detailed Description

RightsManager is used to handle all authorization requests.

Author
ingo herwig ingo@.nosp@m.wemo.nosp@m.ve.co.nosp@m.m

Definition at line 50 of file class.RightsManager.php.

Member Function Documentation

RightsManager::getAuthUserVarname ( )

Get session variable name for the authenticated user.

Returns
The variable name.

Definition at line 75 of file class.RightsManager.php.

Referenced by LoginController\executeKernel(), and getAuthUser().

& RightsManager::getAuthUser ( )

Get authenticated user.

Returns
AuthUser object or null if not logged in.

Definition at line 83 of file class.RightsManager.php.

References $_anonymousUser, getAuthUserVarname(), SessionData\getInstance(), and isAnonymous().

Referenced by authorize().

+ Here is the call graph for this function:

RightsManager::isAnonymous ( )

See if the RightsManager is working in anonymous mode. In anonymous mode all authorization requests answered positive and AuthUser is an instance of AnonymousUser The mode is set in configuration section 'cms' key 'anonymous'

Returns
True/False wether in anonymous mode

Definition at line 108 of file class.RightsManager.php.

References InifileParser\getInstance().

Referenced by authorize(), and getAuthUser().

+ Here is the call graph for this function:

RightsManager::deactivate ( )

Deactivate rights checking by setting the anonymous confguration value.

Definition at line 116 of file class.RightsManager.php.

References InifileParser\getInstance().

+ Here is the call graph for this function:

RightsManager::activate ( )

(Re-)activate rights checking by unsetting the anonymous confguration value.

Definition at line 124 of file class.RightsManager.php.

References InifileParser\getInstance().

+ Here is the call graph for this function:

RightsManager::authorize (   $resource,
  $context,
  $action 
)

Authorize for given resource, context, action triple.

Parameters
resourceThe resource to authorize (e.g. class name of the Controller or OID).
contextThe context in which the action takes place.
actionThe action to process.
Returns
True/False whether authorization succeded/failed.

Definition at line 136 of file class.RightsManager.php.

References $PUBLIC_ACTIONS, AUTHORIZATION_SECTION, PersistenceFacade\decomposeOID(), getAuthUser(), WCMFInifileParser\getInstance(), isAnonymous(), and PersistenceFacade\isValidOID().

+ Here is the call graph for this function:

RightsManager::getRight (   $config,
  $resource,
  $context,
  $action 
)

Get the rights on a resource, context, action combination.

Parameters
configThe configuration file to create the right in.
resourceThe resource (e.g. class name of the Controller or OID).
contextThe context in which the action takes place.
actionThe action to process.
Returns
An assoziative array with keys 'default', 'allow', 'deny' and the attached roles as values.
See Also
AuthUser::parsePolicy

Definition at line 181 of file class.RightsManager.php.

References AUTHORIZATION_SECTION, and AuthUser\parsePolicy().

+ Here is the call graph for this function:

RightsManager::createPermission (   $config,
  $resource,
  $context,
  $action,
  $role,
  $modifier 
)

Create/Change a permission for a role on a resource, context, action combination.

Parameters
configThe configuration file to create the right in.
resourceThe resource (e.g. class name of the Controller or OID).
contextThe context in which the action takes place.
actionThe action to process.
roleThe role to authorize.
modifierOne of the RIGHT_MODIFIER_ constants.
Returns
True/False whether creation succeded/failed.

Definition at line 202 of file class.RightsManager.php.

References modifyRight().

+ Here is the call graph for this function:

RightsManager::removePermission (   $config,
  $resource,
  $context,
  $action,
  $role 
)

Remove a role from a right on a resource, context, action combination.

Parameters
configThe configuration file to remove the right from.
resourceThe resource (e.g. class name of the Controller or OID).
contextThe context in which the action takes place.
actionThe action to process.
roleThe role to remove.
Returns
True/False whether removal succeded/failed.

Definition at line 215 of file class.RightsManager.php.

References modifyRight().

+ Here is the call graph for this function:

RightsManager::modifyRight (   $config,
  $resource,
  $context,
  $action,
  $role,
  $modifier 
)

Modify a right of a role on a resource, context, action combination.

Parameters
configThe configuration file to remove the right from.
resourceThe resource (e.g. class name of the Controller or OID).
contextThe context in which the action takes place.
actionThe action to process.
roleThe role for which to cancel authorization.
modifierOne of the RIGHT_MODIFIER_ constants or null (which means remove role).
Returns
True/False whether modification succeded/failed.

Definition at line 229 of file class.RightsManager.php.

References AUTHORIZATION_SECTION.

Referenced by createPermission(), and removePermission().

Member Data Documentation

RightsManager::$_anonymousUser = null

Definition at line 52 of file class.RightsManager.php.

Referenced by getAuthUser().


The documentation for this class was generated from the following file: