Ubiquity 2.5.2
php rapid development framework
Loading...
Searching...
No Matches
AclManager Class Reference

Ubiquity\security\acl$AclManager This class is part of Ubiquity. More...

+ Inheritance diagram for AclManager:

Static Public Member Functions

static addRole (string $name, ?array $parents=[])
 
static addRoles (array $nameParents)
 
static addResource (string $name, ?string $value=null)
 
static addResources (array $nameValue)
 
static addPermission (string $name, int $level=0)
 
static addPermissions (array $nameLevel)
 
static setPermissionLevel (string $name, int $level)
 
static getRoles ()
 
static getResources ()
 
static getAclList ()
 
static getPermissions ()
 
static getAcls ()
 
static allow (string $role, ?string $resource=' *', ?string $permission='ALL')
 Allow role to access to resource with the permission.
 
static addAndAllow (string $role, ?string $resource=' *', ?string $permission='ALL')
 Add role, resource and permission and allow this role to access to resource with the permission.
 
static isAllowed (string $role, ?string $resource=' *', ?string $permission='ALL')
 Check if access to resource is allowed for role with the permission.
 
static isAllowedRoute (string $role, string $routeName)
 
static saveAll ()
 Save all acls,roles, resources and permissions for AclProviders with no autoSave.
 
static removeRole (string $role)
 
static removePermission (string $permission)
 
static removeResource (string $resource)
 
static removeAcl (string $role, string $resource, ?string $permission=null)
 
static getPermissionMap ()
 
static associate (string $controller, string $action, string $resource, string $permission='ALL')
 
- Static Public Member Functions inherited from AclManagerInit
static start ()
 Create AclList with default roles and resources.
 
static startWithCacheProvider ()
 Start the Acls with AclCacheProvider (for attributes or annotations).
 
static isStarted ()
 Check whether the Acl service is started.
 
static initFromProviders (?array $providers=[])
 Load acls, roles, resources and permissions from providers.
 
static reloadFromSelectedProviders ($selectedProviders=' *')
 
static getProvider (string $providerClass)
 
static getModelClassesSwap ()
 
static filterProviders (string $providerClass)
 
static removefilterProviders ()
 
static initializeDAOProvider (array &$config, string $dbOffset='default', array $classes=[])
 Initializes AclDAOProvider and creates ACL tables in the specified dbOffset.
 
static initCache (array &$config, bool $silent=false)
 Initialize acls cache with controllers annotations.
 
static checkCache (array &$config)
 
- Static Public Member Functions inherited from AclManagerTester
static cacheUpdated ()
 Checks if ACL cache is updated.
 
static existPartIn (AbstractAclPart $part, string $providerClass)
 
static existAclIn (AclElement $elm, string $providerClass)
 
static roleExists (string $roleName)
 
static resourceExists (string $resourceName)
 
static permissionExists (string $permissionName)
 

Static Protected Attributes

static AclList $aclList =null
 
static PermissionsMap $permissionMap
 
static array $providersPersistence
 

Additional Inherited Members

- Static Protected Member Functions inherited from AclManagerInit
static registerAnnotations ()
 

Detailed Description

Ubiquity\security\acl$AclManager This class is part of Ubiquity.

Author
jc
Version
1.0.2

Definition at line 30 of file AclManager.php.

Member Function Documentation

◆ addAndAllow()

static addAndAllow ( string  $role,
?string  $resource = '*',
?string  $permission = 'ALL' 
)
static

Add role, resource and permission and allow this role to access to resource with the permission.

Parameters
string$role
?string$resource
?string$permission

Definition at line 115 of file AclManager.php.

◆ addPermission()

static addPermission ( string  $name,
int  $level = 0 
)
static

Definition at line 59 of file AclManager.php.

◆ addPermissions()

static addPermissions ( array  $nameLevel)
static

Definition at line 63 of file AclManager.php.

◆ addResource()

static addResource ( string  $name,
?string  $value = null 
)
static

Definition at line 49 of file AclManager.php.

◆ addResources()

static addResources ( array  $nameValue)
static

Definition at line 53 of file AclManager.php.

◆ addRole()

static addRole ( string  $name,
?array  $parents = [] 
)
static

Definition at line 39 of file AclManager.php.

◆ addRoles()

static addRoles ( array  $nameParents)
static

Definition at line 43 of file AclManager.php.

◆ allow()

static allow ( string  $role,
?string  $resource = '*',
?string  $permission = 'ALL' 
)
static

Allow role to access to resource with the permission.

Parameters
string$role
?string$resource
?string$permission

Definition at line 104 of file AclManager.php.

◆ associate()

static associate ( string  $controller,
string  $action,
string  $resource,
string  $permission = 'ALL' 
)
static
Parameters
string$controller
string$action
string$resource
string$permission

Definition at line 215 of file AclManager.php.

◆ getAclList()

static getAclList ( )
static
Returns
\Ubiquity\security\acl\models\AclList

Definition at line 85 of file AclManager.php.

◆ getAcls()

static getAcls ( )
static

Definition at line 93 of file AclManager.php.

◆ getPermissionMap()

static getPermissionMap ( )
static
Returns
\Ubiquity\security\acl\cache\PermissionsMap

Definition at line 200 of file AclManager.php.

◆ getPermissions()

static getPermissions ( )
static

Definition at line 89 of file AclManager.php.

◆ getResources()

static getResources ( )
static

Definition at line 77 of file AclManager.php.

◆ getRoles()

static getRoles ( )
static

Definition at line 73 of file AclManager.php.

◆ isAllowed()

static isAllowed ( string  $role,
?string  $resource = '*',
?string  $permission = 'ALL' 
)
static

Check if access to resource is allowed for role with the permission.

Parameters
string$role
?string$resource
?string$permission
Returns
bool

Definition at line 127 of file AclManager.php.

◆ isAllowedRoute()

static isAllowedRoute ( string  $role,
string  $routeName 
)
static

Definition at line 131 of file AclManager.php.

◆ removeAcl()

static removeAcl ( string  $role,
string  $resource,
?string  $permission = null 
)
static
Parameters
string$role
string$resource
?string$permission

Definition at line 192 of file AclManager.php.

◆ removePermission()

static removePermission ( string  $permission)
static
Parameters
string$permission

Definition at line 174 of file AclManager.php.

◆ removeResource()

static removeResource ( string  $resource)
static
Parameters
string$resource

Definition at line 182 of file AclManager.php.

◆ removeRole()

static removeRole ( string  $role)
static
Parameters
string$role

Definition at line 166 of file AclManager.php.

◆ saveAll()

static saveAll ( )
static

Save all acls,roles, resources and permissions for AclProviders with no autoSave.

Definition at line 158 of file AclManager.php.

◆ setPermissionLevel()

static setPermissionLevel ( string  $name,
int  $level 
)
static

Definition at line 69 of file AclManager.php.

Field Documentation

◆ $aclList

AclList $aclList =null
staticprotected

Definition at line 32 of file AclManager.php.

◆ $permissionMap

PermissionsMap $permissionMap
staticprotected

Definition at line 34 of file AclManager.php.

◆ $providersPersistence

array $providersPersistence
staticprotected

Definition at line 36 of file AclManager.php.


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