PHP Class Scalr\Acl\Role\RoleObject

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

Public Methods

Method 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 method

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 method

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

getIteratorResources() public method

Gets iterator of all predefined resources with unique permissions

getName() public method

Gets the name of the ACL role
public getName ( ) : string
return string Returns the name of the ACL role

getResource() public method

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

getResources() public method

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

getRoleId() public method

Gets the Id of the ACL role
public getRoleId ( ) : integer
return integer Returns the ID of the ACL role

isAllowed() public method

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.
return boolean | null Returns true if access is allowed. If resource or permission isn't overridden it returns null.

isOverridden() public method

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.
return boolean Returns true if permission is overriden

setName() public method

Sets the name of the role
public setName ( string $name ) : RoleObject
$name string The name of the role
return RoleObject

setRoleId() public method

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