PHP 클래스 Airship\Cabin\Bridge\Blueprint\Permissions

This is used by administrative users to manage access controls throughout various cabins.
상속: extends BlueprintGear
파일 보기 프로젝트 열기: paragonie/airship 1 사용 예제들

공개 메소드들

메소드 설명
buildGroupTree ( string $cabin, integer $contextId, array $actions = [], integer $parentId, array $inherited = [], integer $depth ) : array Build a hierarchical tree containing all of the groups' permissions
buildMultiContextGroupTree ( string $cabin, array $contexts = [], array $actions = [] ) : array Build a multi-context tree; make sure to && the permissions together
buildMultiContextUserList ( string $cabin, array $contexts = [], array $actions = [] ) : array Build a multi-context tree; make sure to && the permissions together
buildUserList ( string $cabin, integer $contextId, array $actions = [] ) : array Build a heirarchal tree containing all of the groups' permissions
createAction ( string $cabin, string $label ) : boolean Create a new database action for a specific Cabin.
createContext ( string $cabin, string $locator ) : boolean Create a new context for a specific cabin.
getAction ( string $cabin, integer $actionId ) : array Get information about an action.
getActionNames ( string $cabin ) : array Get all action labels for a particular cabin.
getActions ( string $cabin ) : array List all actions for a cabin.
getContext ( integer $contextId, string $cabin = CABIN_NAME ) : array Get all contexts for a cabin
getContextIds ( string $uri = '', string $cabin = CABIN_NAME ) : array Returns an array with overlapping context IDs -- useful for when contexts are used with regular expressions
getContexts ( string $cabin = CABIN_NAME ) : array Get all contexts for a cabin
getContextsForURI ( string $uri = '', string $cabin = CABIN_NAME ) : array Returns an array with overlapping context IDs -- useful for when contexts are used with regular expressions
getGroupPerms ( integer $groupId, integer $contextId ) : array
getUserPerms ( integer $userId, integer $contextId ) : array
saveAction ( string $cabin, integer $actionId, array $post = [] ) : boolean Update the label for a given action.
saveContext ( string $cabin, integer $contextId, array $post ) : boolean Saves a permission context. This affects the context itself as well as the whitelist.

보호된 메소드들

메소드 설명
flattenContextList ( array $return, array $perms, array $actions = [] ) : array
flattenContextTree ( array $return, array $perms, array $actions = [] ) : array
flattenMultiContextList ( array $return, array $contexts, array $actions = [] ) : array Flatten multiple context lists.
flattenMultiContextTree ( array $return, array $contexts, array $actions = [] ) : array
getGroupRulesForContextSave ( array $actions, integer $contextId ) : array
getUserRulesForContextSave ( array $actions, integer $contextId ) : array
permBoolean ( array $postValue = [], array $keys = [] ) : array

메소드 상세

buildGroupTree() 공개 메소드

Build a hierarchical tree containing all of the groups' permissions
public buildGroupTree ( string $cabin, integer $contextId, array $actions = [], integer $parentId, array $inherited = [], integer $depth ) : array
$cabin string Which cabin does this apply to?
$contextId integer Context IDs (see permissions sql)
$actions array Actions in Scope [ [id => label], [id2 => label2] ]
$parentId integer The group whose children we are evaluating
$inherited array
$depth integer the depth of our recursive search
리턴 array

buildMultiContextGroupTree() 공개 메소드

Build a multi-context tree; make sure to && the permissions together
public buildMultiContextGroupTree ( string $cabin, array $contexts = [], array $actions = [] ) : array
$cabin string
$contexts array
$actions array
리턴 array

buildMultiContextUserList() 공개 메소드

Build a multi-context tree; make sure to && the permissions together
public buildMultiContextUserList ( string $cabin, array $contexts = [], array $actions = [] ) : array
$cabin string
$contexts array
$actions array
리턴 array

buildUserList() 공개 메소드

Build a heirarchal tree containing all of the groups' permissions
public buildUserList ( string $cabin, integer $contextId, array $actions = [] ) : array
$cabin string Which cabin does this apply to?
$contextId integer Context IDs (see permissions sql)
$actions array Actions in Scope [[id => label], [id2 => label2]]
리턴 array

createAction() 공개 메소드

Create a new database action for a specific Cabin.
public createAction ( string $cabin, string $label ) : boolean
$cabin string
$label string
리턴 boolean

createContext() 공개 메소드

Create a new context for a specific cabin.
public createContext ( string $cabin, string $locator ) : boolean
$cabin string
$locator string
리턴 boolean

flattenContextList() 보호된 메소드

protected flattenContextList ( array $return, array $perms, array $actions = [] ) : array
$return array
$perms array
$actions array
리턴 array

flattenContextTree() 보호된 메소드

protected flattenContextTree ( array $return, array $perms, array $actions = [] ) : array
$return array
$perms array
$actions array
리턴 array

flattenMultiContextList() 보호된 메소드

Flatten multiple context lists.
protected flattenMultiContextList ( array $return, array $contexts, array $actions = [] ) : array
$return array
$contexts array
$actions array
리턴 array

flattenMultiContextTree() 보호된 메소드

protected flattenMultiContextTree ( array $return, array $contexts, array $actions = [] ) : array
$return array
$contexts array
$actions array
리턴 array

getAction() 공개 메소드

Get information about an action.
public getAction ( string $cabin, integer $actionId ) : array
$cabin string
$actionId integer
리턴 array

getActionNames() 공개 메소드

Get all action labels for a particular cabin.
public getActionNames ( string $cabin ) : array
$cabin string
리턴 array

getActions() 공개 메소드

List all actions for a cabin.
public getActions ( string $cabin ) : array
$cabin string
리턴 array

getContext() 공개 메소드

Get all contexts for a cabin
public getContext ( integer $contextId, string $cabin = CABIN_NAME ) : array
$contextId integer
$cabin string Cabin
리턴 array

getContextIds() 공개 메소드

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

getContexts() 공개 메소드

Get all contexts for a cabin
public getContexts ( string $cabin = CABIN_NAME ) : array
$cabin string Cabin
리턴 array

getContextsForURI() 공개 메소드

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

getGroupPerms() 공개 메소드

public getGroupPerms ( integer $groupId, integer $contextId ) : array
$groupId integer
$contextId integer
리턴 array

getGroupRulesForContextSave() 보호된 메소드

protected getGroupRulesForContextSave ( array $actions, integer $contextId ) : array
$actions array
$contextId integer
리턴 array

getUserPerms() 공개 메소드

public getUserPerms ( integer $userId, integer $contextId ) : array
$userId integer
$contextId integer
리턴 array

getUserRulesForContextSave() 보호된 메소드

protected getUserRulesForContextSave ( array $actions, integer $contextId ) : array
$actions array
$contextId integer
리턴 array

permBoolean() 보호된 메소드

protected permBoolean ( array $postValue = [], array $keys = [] ) : array
$postValue array
$keys array
리턴 array

saveAction() 공개 메소드

Update the label for a given action.
public saveAction ( string $cabin, integer $actionId, array $post = [] ) : boolean
$cabin string
$actionId integer
$post array
리턴 boolean

saveContext() 공개 메소드

Saves a permission context. This affects the context itself as well as the whitelist.
public saveContext ( string $cabin, integer $contextId, array $post ) : boolean
$cabin string Which Cabin?
$contextId integer Which context?
$post array POST data
리턴 boolean