PHP 클래스 Jarves\ACLRequest

$acl->check($request): boolean
파일 보기 프로젝트 열기: jarves/jarves 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$asParent boolean Defines whether this request should be checked as a parent object. This means, it excludes all rules with sub=0 (rules that do not apply to sub-items/children)
$field string | null | array Example: 'title' or ['language' => 'en']
$mode integer ACL::MODE_ALL, ACL::MODE_LISTING, ACL::MODE_VIEW, ACL::MODE_ADD, ACL::MODE_UPDATE, ACL::MODE_DELETE
$objectKey string Example: jarves/node
$primaryKey array | string | null If not defined, rules that have a constraint to a exactly object item are ignored. This includes: Rules that are applied to parent objects and have sub=true and exact rules that are applied to a particular object item. Actually only ACL::CONSTRAINT_ALL are checked then, usually needed for mode==ACL::LISTING String representation as seen in Jarves\Objects::normalizePkString also allowed and will be converted to a real primaryKey array when used.
$primaryObjectItem null | array When a primaryKey is given and we have rules based on fields of a object item, the ACL system needs to fetch this item based on $primaryKey. To speed things up and to check against not yet created objects (like during a 'add'-check), you should pass the actual objectItem to this request.
$rootHasAccess boolean For nested set, the ACL system iterates through all parents. If no rule applies or all rules are from access=inherited, then this option defines whether ACL::check() returns true or false.
$targetId null | integer If not defined current user id from current session is used.
$targetType null ACL::TARGET_TYPE_USER, ACL::TARGET_TYPE_GROUP

공개 메소드들

메소드 설명
__construct ( string $objectKey, string | array | null $primaryKey = null )
create ( string $objectKey, string | array | null $primaryKey = null ) : static
getField ( ) : array | null | string
getMode ( ) : integer
getObjectKey ( ) : string
getPrimaryKey ( ) : array | null
getPrimaryObjectItem ( ) : array | string | null
getTargetId ( ) : integer | null
getTargetType ( ) : null
isAsParent ( ) : boolean
isRootHasAccess ( ) : boolean
onlyAddMode ( )
onlyDeleteMode ( )
onlyListingMode ( )
onlyUpdateMode ( )
onlyViewMode ( )
setAsParent ( boolean $asParent )
setField ( array | null | string $field )
setMode ( integer $mode )
setObjectKey ( string $objectKey )
setPrimaryKey ( string | array | null $primaryKey )
setPrimaryObjectItem ( array $primaryObjectItem = null )
setRootHasAccess ( boolean $rootHasAccess )
setTargetId ( integer | null $targetId )
setTargetType ( null $targetType )
targetGroup ( integer $groupId ) Sets targetId= $groupId and targetType = ACL::TARGET_TYPE_GROUP
targetUser ( integer $userId ) Sets targetId= $userId and targetType = ACL::TARGET_TYPE_USER

메소드 상세

__construct() 공개 메소드

public __construct ( string $objectKey, string | array | null $primaryKey = null )
$objectKey string
$primaryKey string | array | null see ACLRequest::$primaryKey

create() 공개 정적인 메소드

public static create ( string $objectKey, string | array | null $primaryKey = null ) : static
$objectKey string
$primaryKey string | array | null see ACLRequest::$primaryKey
리턴 static

getField() 공개 메소드

public getField ( ) : array | null | string
리턴 array | null | string

getMode() 공개 메소드

public getMode ( ) : integer
리턴 integer

getObjectKey() 공개 메소드

public getObjectKey ( ) : string
리턴 string

getPrimaryKey() 공개 메소드

public getPrimaryKey ( ) : array | null
리턴 array | null

getPrimaryObjectItem() 공개 메소드

public getPrimaryObjectItem ( ) : array | string | null
리턴 array | string | null

getTargetId() 공개 메소드

public getTargetId ( ) : integer | null
리턴 integer | null

getTargetType() 공개 메소드

public getTargetType ( ) : null
리턴 null

isAsParent() 공개 메소드

public isAsParent ( ) : boolean
리턴 boolean

isRootHasAccess() 공개 메소드

public isRootHasAccess ( ) : boolean
리턴 boolean

onlyAddMode() 공개 메소드

public onlyAddMode ( )

onlyDeleteMode() 공개 메소드

public onlyDeleteMode ( )

onlyListingMode() 공개 메소드

public onlyListingMode ( )

onlyUpdateMode() 공개 메소드

public onlyUpdateMode ( )

onlyViewMode() 공개 메소드

public onlyViewMode ( )

setAsParent() 공개 메소드

public setAsParent ( boolean $asParent )
$asParent boolean

setField() 공개 메소드

public setField ( array | null | string $field )
$field array | null | string

setMode() 공개 메소드

public setMode ( integer $mode )
$mode integer ACL::MODE_ALL, ACL::MODE_LISTING, ACL::MODE_VIEW, ACL::MODE_ADD, ACL::MODE_UPDATE, ACL::MODE_DELETE

setObjectKey() 공개 메소드

public setObjectKey ( string $objectKey )
$objectKey string

setPrimaryKey() 공개 메소드

public setPrimaryKey ( string | array | null $primaryKey )
$primaryKey string | array | null see ACLRequest::$primaryKey

setPrimaryObjectItem() 공개 메소드

public setPrimaryObjectItem ( array $primaryObjectItem = null )
$primaryObjectItem array

setRootHasAccess() 공개 메소드

public setRootHasAccess ( boolean $rootHasAccess )
$rootHasAccess boolean

setTargetId() 공개 메소드

public setTargetId ( integer | null $targetId )
$targetId integer | null

setTargetType() 공개 메소드

public setTargetType ( null $targetType )
$targetType null

targetGroup() 공개 메소드

Sets targetId= $groupId and targetType = ACL::TARGET_TYPE_GROUP
public targetGroup ( integer $groupId )
$groupId integer

targetUser() 공개 메소드

Sets targetId= $userId and targetType = ACL::TARGET_TYPE_USER
public targetUser ( integer $userId )
$userId integer

프로퍼티 상세

$asParent 보호되어 있는 프로퍼티

Defines whether this request should be checked as a parent object. This means, it excludes all rules with sub=0 (rules that do not apply to sub-items/children)
protected bool $asParent
리턴 boolean

$field 보호되어 있는 프로퍼티

Example: 'title' or ['language' => 'en']
protected string|null|array $field
리턴 string | null | array

$mode 보호되어 있는 프로퍼티

ACL::MODE_ALL, ACL::MODE_LISTING, ACL::MODE_VIEW, ACL::MODE_ADD, ACL::MODE_UPDATE, ACL::MODE_DELETE
protected int $mode
리턴 integer

$objectKey 보호되어 있는 프로퍼티

Example: jarves/node
protected string $objectKey
리턴 string

$primaryKey 보호되어 있는 프로퍼티

If not defined, rules that have a constraint to a exactly object item are ignored. This includes: Rules that are applied to parent objects and have sub=true and exact rules that are applied to a particular object item. Actually only ACL::CONSTRAINT_ALL are checked then, usually needed for mode==ACL::LISTING String representation as seen in Jarves\Objects::normalizePkString also allowed and will be converted to a real primaryKey array when used.
protected array|string|null $primaryKey
리턴 array | string | null

$primaryObjectItem 보호되어 있는 프로퍼티

When a primaryKey is given and we have rules based on fields of a object item, the ACL system needs to fetch this item based on $primaryKey. To speed things up and to check against not yet created objects (like during a 'add'-check), you should pass the actual objectItem to this request.
protected null|array $primaryObjectItem
리턴 null | array

$rootHasAccess 보호되어 있는 프로퍼티

For nested set, the ACL system iterates through all parents. If no rule applies or all rules are from access=inherited, then this option defines whether ACL::check() returns true or false.
protected bool $rootHasAccess
리턴 boolean

$targetId 보호되어 있는 프로퍼티

If not defined current user id from current session is used.
protected null|int $targetId
리턴 null | integer

$targetType 보호되어 있는 프로퍼티

ACL::TARGET_TYPE_USER, ACL::TARGET_TYPE_GROUP
protected null $targetType
리턴 null