PHP 클래스 Airship\Engine\Security\Permissions

Manages user-based and role-based access controls with overlapping pattern-based contexts and a multi-site architecture, with a simple interface. i.e. $this->can('read') // bool(false)
파일 보기 프로젝트 열기: paragonie/airship

공개 메소드들

메소드 설명
__construct ( DBInterface $db )
can ( string $action, string $context_path = '', string $cabin = CABIN_NAME, integer $user_id ) : boolean Perform a permissions check
checkGroup ( string $action, integer $context_id = null, integer $group_id = null, boolean $deep_search = true ) : boolean Do the members of this group have permission to do something?
checkUser ( string $action, integer $context_id = null, integer $user_id = null, boolean $ignore_superuser = false ) : boolean Check that the user, specifically, has permission to do something.
checkUsersGroups ( string $action = '', integer $context_id = null, integer $user_id = null, boolean $ignore_superuser = false ) : boolean Check that any of the users' groups has the permission bit
getOverlap ( string $context = '', string $cabin = CABIN_NAME ) : array Returns an array with overlapping context IDs -- useful for when contexts are used with regular expressions
isSuperUser ( integer $user_id, boolean $ignore_groups = false ) : boolean Is this user a super user? Do they belong in a superuser group?

메소드 상세

__construct() 공개 메소드

public __construct ( DBInterface $db )
$db DBInterface

can() 공개 메소드

Perform a permissions check
public can ( string $action, string $context_path = '', string $cabin = CABIN_NAME, integer $user_id ) : boolean
$action string action label (e.g. 'read')
$context_path string context regex (in perm_contexts)
$cabin string (defaults to current cabin)
$user_id integer (defaults to current user)
리턴 boolean

checkGroup() 공개 메소드

Do the members of this group have permission to do something?
public checkGroup ( string $action, integer $context_id = null, integer $group_id = null, boolean $deep_search = true ) : boolean
$action string - perm_actions.label
$context_id integer - perm_contexts.contextid
$group_id integer - groups.groupid
$deep_search boolean - Also search groups' inheritances
리턴 boolean

checkUser() 공개 메소드

Ignores group-based access controls.
public checkUser ( string $action, integer $context_id = null, integer $user_id = null, boolean $ignore_superuser = false ) : boolean
$action string
$context_id integer
$user_id integer
$ignore_superuser boolean
리턴 boolean

checkUsersGroups() 공개 메소드

Check that any of the users' groups has the permission bit
public checkUsersGroups ( string $action = '', integer $context_id = null, integer $user_id = null, boolean $ignore_superuser = false ) : boolean
$action string
$context_id integer
$user_id integer
$ignore_superuser boolean
리턴 boolean

getOverlap() 공개 메소드

Returns an array with overlapping context IDs -- useful for when contexts are used with regular expressions
public getOverlap ( string $context = '', string $cabin = CABIN_NAME ) : array
$context string Context
$cabin string Cabin
리턴 array

isSuperUser() 공개 메소드

Is this user a super user? Do they belong in a superuser group?
public isSuperUser ( integer $user_id, boolean $ignore_groups = false ) : boolean
$user_id integer - User ID
$ignore_groups boolean - Don't look at their groups
리턴 boolean