PHP Class Xpressengine\Permission\Policy

Author: XE Developers ([email protected])
Datei anzeigen Open project: xpressengine/xpressengine

Protected Properties

Property Type Description
$perm PermissionHandler PermissionHandler instance
$vgroups Xpressengine\User\Repositories\VirtualGroupRepositoryInterface VirtualGroupRepository instance

Public Methods

Method Description
__construct ( PermissionHandler $perm, Xpressengine\User\Repositories\VirtualGroupRepositoryInterface $vgroups ) Policy constructor.

Protected Methods

Method Description
check ( Xpressengine\User\UserInterface $user, Permission $permission, string $action ) : boolean Check allows
checker ( Xpressengine\User\UserInterface $user, string $type, mixed $value ) : boolean 타입에 맞는 권한 판별 메서드를 호출 함.
extractExcepts ( array &$grants ) : array Extract except user information
get ( string $name, string $siteKey = 'default' ) : Permission | null Get a permission
groupInspect ( Xpressengine\User\UserInterface $user, array $criterion ) : boolean User 가 속한 그룹이 권한이 있는지 판별.
isExcepted ( Xpressengine\User\UserInterface $user, array $userIds = [] ) : boolean Check except user
isGuest ( Xpressengine\User\UserInterface $user ) : boolean 전달된 사용자가 guest 인지 확인
ratingInspect ( Xpressengine\User\UserInterface $user, string $criterion ) : boolean User 가 권한이 있는 등급인지 판별
userInspect ( Xpressengine\User\UserInterface $user, array $criterion ) : boolean User 가 권한이 있는 대상으로 지정되어 있는지 판별
userRating ( Xpressengine\User\UserInterface $user ) : string Get a User's rating keyword
vgroupInspect ( Xpressengine\User\UserInterface $user, array $criterion ) : boolean User 가 속한 가상그룹이 권한이 있는지 판별.

Method Details

__construct() public method

Policy constructor.
public __construct ( PermissionHandler $perm, Xpressengine\User\Repositories\VirtualGroupRepositoryInterface $vgroups )
$perm PermissionHandler PermissionHandler instance
$vgroups Xpressengine\User\Repositories\VirtualGroupRepositoryInterface VirtualGroupRepository instance

check() protected method

Check allows
protected check ( Xpressengine\User\UserInterface $user, Permission $permission, string $action ) : boolean
$user Xpressengine\User\UserInterface user instance
$permission Permission permission instance
$action string action keyword
return boolean

checker() protected method

타입에 맞는 권한 판별 메서드를 호출 함.
protected checker ( Xpressengine\User\UserInterface $user, string $type, mixed $value ) : boolean
$user Xpressengine\User\UserInterface user instance
$type string check type
$value mixed given value
return boolean

extractExcepts() protected method

Extract except user information
protected extractExcepts ( array &$grants ) : array
$grants array all grants information
return array user identifiers

get() protected method

Get a permission
protected get ( string $name, string $siteKey = 'default' ) : Permission | null
$name string permission name
$siteKey string site key name
return Permission | null

groupInspect() protected method

User 가 속한 그룹이 권한이 있는지 판별.
protected groupInspect ( Xpressengine\User\UserInterface $user, array $criterion ) : boolean
$user Xpressengine\User\UserInterface user instance
$criterion array criterion group ids
return boolean

isExcepted() protected method

Check except user
protected isExcepted ( Xpressengine\User\UserInterface $user, array $userIds = [] ) : boolean
$user Xpressengine\User\UserInterface user instance
$userIds array except target identifiers
return boolean

isGuest() protected method

전달된 사용자가 guest 인지 확인
protected isGuest ( Xpressengine\User\UserInterface $user ) : boolean
$user Xpressengine\User\UserInterface user instance
return boolean

ratingInspect() protected method

User 가 권한이 있는 등급인지 판별
protected ratingInspect ( Xpressengine\User\UserInterface $user, string $criterion ) : boolean
$user Xpressengine\User\UserInterface user instance
$criterion string user rating keyword
return boolean

userInspect() protected method

User 가 권한이 있는 대상으로 지정되어 있는지 판별
protected userInspect ( Xpressengine\User\UserInterface $user, array $criterion ) : boolean
$user Xpressengine\User\UserInterface user instance
$criterion array criterion user ids
return boolean

userRating() protected method

Get a User's rating keyword
protected userRating ( Xpressengine\User\UserInterface $user ) : string
$user Xpressengine\User\UserInterface user instance
return string

vgroupInspect() protected method

User 가 속한 가상그룹이 권한이 있는지 판별.
protected vgroupInspect ( Xpressengine\User\UserInterface $user, array $criterion ) : boolean
$user Xpressengine\User\UserInterface user instance
$criterion array criterion vgroup ids
return boolean

Property Details

$perm protected_oe property

PermissionHandler instance
protected PermissionHandler,Xpressengine\Permission $perm
return PermissionHandler

$vgroups protected_oe property

VirtualGroupRepository instance
protected VirtualGroupRepositoryInterface,Xpressengine\User\Repositories $vgroups
return Xpressengine\User\Repositories\VirtualGroupRepositoryInterface