Detailed Description

StaticPermissionManager retrieves authorization rules from the application configuration.

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

Definition at line 30 of file StaticPermissionManager.php.

+ Inheritance diagram for StaticPermissionManager:

Public Member Functions

 __construct (PersistenceFacade $persistenceFacade, Session $session, Configuration $configuration)
 
 getPermissions ($resource, $context, $action)
 
 setPermissions ($resource, $context, $action, $permissions)
 
 createPermission ($resource, $context, $action, $role, $modifier)
 
 removePermission ($resource, $context, $action, $role)
 
- Public Member Functions inherited from AbstractPermissionManager
 __construct (PersistenceFacade $persistenceFacade, Session $session, array $dynamicRoles=[])
 
 setPrincipalFactory (PrincipalFactory $principalFactory)
 
 authorize ($resource, $context, $action, $login=null, $applyDefaultPolicy=true)
 
 addTempPermission ($resource, $context, $action)
 
 removeTempPermission ($handle)
 
 hasTempPermission ($resource, $context, $action)
 
 clearTempPermissions ()
 

Public Attributes

const AUTHORIZATION_SECTION = 'authorization'
 
- Public Attributes inherited from AbstractPermissionManager
const RESOURCE_TYPE_ENTITY_TYPE = 'entity.type'
 
const RESOURCE_TYPE_ENTITY_TYPE_PROPERTY = 'entity.type.property'
 
const RESOURCE_TYPE_ENTITY_INSTANCE = 'entity.instance'
 
const RESOURCE_TYPE_ENTITY_INSTANCE_PROPERTY = 'entity.instance.property'
 
const RESOURCE_TYPE_OTHER = 'other'
 
- Public Attributes inherited from PermissionManager
const PERMISSION_MODIFIER_ALLOW = '+'
 
const PERMISSION_MODIFIER_DENY = '-'
 

Protected Member Functions

 modifyPermission ($resource, $context, $action, $role, $modifier)
 
 getConfigurationInstance ()
 
- Protected Member Functions inherited from AbstractPermissionManager
 authorizeAction ($requestedResource, $permissionResource, $context, $action, $login)
 
 getDefaultPolicy ($login)
 
 parseResource ($resource)
 
 deserializePermissions ($value)
 
 serializePermissions ($permissions)
 
 matchRoles ($resource, $permissions, $login)
 
 matchRole (User $user, $role, $resource)
 

Additional Inherited Members

- Protected Attributes inherited from AbstractPermissionManager
 $persistenceFacade = null
 
 $session = null
 
 $dynamicRoles = []
 
 $principalFactory = null
 

Constructor & Destructor Documentation

◆ __construct()

__construct ( PersistenceFacade  $persistenceFacade,
Session  $session,
Configuration  $configuration 
)

Constructor.

Parameters
$persistenceFacade
$session
$configuration

Definition at line 45 of file StaticPermissionManager.php.

Member Function Documentation

◆ getPermissions()

getPermissions (   $resource,
  $context,
  $action 
)

◆ setPermissions()

setPermissions (   $resource,
  $context,
  $action,
  $permissions 
)

◆ createPermission()

createPermission (   $resource,
  $context,
  $action,
  $role,
  $modifier 
)

◆ removePermission()

removePermission (   $resource,
  $context,
  $action,
  $role 
)

◆ modifyPermission()

modifyPermission (   $resource,
  $context,
  $action,
  $role,
  $modifier 
)
protected

Modify a permission for the given role.

Parameters
$resourceThe resource (e.g. class name of the Controller or object id).
$contextThe context in which the action takes place.
$actionThe action to process.
$roleThe role to authorize.
$modifierOne of the PERMISSION_MODIFIER_ constants, null, if the permission should be removed.
Returns
boolean

Definition at line 124 of file StaticPermissionManager.php.

◆ getConfigurationInstance()

getConfigurationInstance ( )
protected

Get the configuration instance and file that is used to store the permissions.

Returns
Associative array with keys 'instance' and 'file'.

Definition at line 157 of file StaticPermissionManager.php.

Member Data Documentation

◆ AUTHORIZATION_SECTION

const AUTHORIZATION_SECTION = 'authorization'

Definition at line 32 of file StaticPermissionManager.php.