PHP Класс Scalr\Acl\Role\RoleObject

Describes ACL Role object
С версии: 31.07.2013
Автор: Vitaliy Demidov ([email protected])
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__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

Описание методов

__construct() публичный Метод

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

appendResource() публичный Метод

Appends access rule to resource
public appendResource ( Scalr\Acl\Role\RoleResourceObject $resource ) : RoleObject
$resource Scalr\Acl\Role\RoleResourceObject The role resource object.
Результат RoleObject

getIteratorResources() публичный Метод

Gets iterator of all predefined resources with unique permissions
public getIteratorResources ( ) : ArrayIterator
Результат ArrayIterator

getName() публичный Метод

Gets the name of the ACL role
public getName ( ) : string
Результат string Returns the name of the ACL role

getResource() публичный Метод

Gets specified resource
public getResource ( integer $resourceId ) : Scalr\Acl\Role\RoleResourceObject
$resourceId integer The ID of the ACL resource
Результат Scalr\Acl\Role\RoleResourceObject Returns resource object if access has been set for it.

getResources() публичный Метод

Gets the list of access rules to resources associated with the role.
public getResources ( ) : ArrayObject
Результат ArrayObject Returns the list of the access rules.

getRoleId() публичный Метод

Gets the Id of the ACL role
public getRoleId ( ) : integer
Результат integer Returns the ID of the ACL role

isAllowed() публичный Метод

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.
Результат boolean | null Returns true if access is allowed. If resource or permission isn't overridden it returns null.

isOverridden() публичный Метод

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.
Результат boolean Returns true if permission is overriden

setName() публичный Метод

Sets the name of the role
public setName ( string $name ) : RoleObject
$name string The name of the role
Результат RoleObject

setRoleId() публичный Метод

Sets the ID of the Role
public setRoleId ( integer $roleId ) : RoleObject
$roleId integer The ID of the role
Результат RoleObject