PHP Class Scalr\Acl\Role\RoleObject

Describes ACL Role object
Since: 31.07.2013
Author: Vitaliy Demidov ([email protected])
Afficher le fichier Open project: scalr/scalr Class Usage Examples

Méthodes publiques

Méthode Description
__construct ( integer $roleId, string $name ) Constructor
appendResource ( Scalr\Acl\Role\RoleResourceObject $resource ) : RoleObject Appends access rule to resource
getIteratorResources ( ) : ArrayIterator Gets iterator of all predefined resources with unique permissions
getName ( ) : string Gets the name of the ACL role
getResource ( integer $resourceId ) : Scalr\Acl\Role\RoleResourceObject Gets specified resource
getResources ( ) : ArrayObject Gets the list of access rules to resources associated with the role.
getRoleId ( ) : integer Gets the Id of the ACL role
isAllowed ( integer $resourceId, string $permissionId = null ) : boolean | null Checks if specified resource is allowed
isOverridden ( integer $resourceId, string $permissionId = null ) : boolean Checks if this resource has been overridden in this role
setName ( string $name ) : RoleObject Sets the name of the role
setRoleId ( integer $roleId ) : RoleObject Sets the ID of the Role

Method Details

__construct() public méthode

Constructor
public __construct ( integer $roleId, string $name )
$roleId integer The ID of the ACL role
$name string The name of the ACL role

appendResource() public méthode

Appends access rule to resource
public appendResource ( Scalr\Acl\Role\RoleResourceObject $resource ) : RoleObject
$resource Scalr\Acl\Role\RoleResourceObject The role resource object.
Résultat RoleObject

getIteratorResources() public méthode

Gets iterator of all predefined resources with unique permissions

getName() public méthode

Gets the name of the ACL role
public getName ( ) : string
Résultat string Returns the name of the ACL role

getResource() public méthode

Gets specified resource
public getResource ( integer $resourceId ) : Scalr\Acl\Role\RoleResourceObject
$resourceId integer The ID of the ACL resource
Résultat Scalr\Acl\Role\RoleResourceObject Returns resource object if access has been set for it.

getResources() public méthode

Gets the list of access rules to resources associated with the role.
public getResources ( ) : ArrayObject
Résultat ArrayObject Returns the list of the access rules.

getRoleId() public méthode

Gets the Id of the ACL role
public getRoleId ( ) : integer
Résultat integer Returns the ID of the ACL role

isAllowed() public méthode

Checks if specified resource is allowed
public isAllowed ( integer $resourceId, string $permissionId = null ) : boolean | null
$resourceId integer The ID of the resource.
$permissionId string optional The ID of the permission associated with resource.
Résultat boolean | null Returns true if access is allowed. If resource or permission isn't overridden it returns null.

isOverridden() public méthode

Checks if this resource has been overridden in this role
public isOverridden ( integer $resourceId, string $permissionId = null ) : boolean
$resourceId integer The ID of the resource.
$permissionId string optional The ID of the permission associated with resource.
Résultat boolean Returns true if permission is overriden

setName() public méthode

Sets the name of the role
public setName ( string $name ) : RoleObject
$name string The name of the role
Résultat RoleObject

setRoleId() public méthode

Sets the ID of the Role
public setRoleId ( integer $roleId ) : RoleObject
$roleId integer The ID of the role
Résultat RoleObject