PHP 클래스 Scalr\Acl\Role\RoleObject

Describes ACL Role object
부터: 31.07.2013
저자: Vitaliy Demidov ([email protected])
파일 보기 프로젝트 열기: scalr/scalr 1 사용 예제들

공개 메소드들

메소드 설명
__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

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