PHP 클래스 yii\rbac\BaseManager

For more details and usage information on DbManager, see the guide article on security authorization.
부터: 2.0
저자: Qiang Xue ([email protected])
상속: extends yii\base\Component, implements yii\rbac\ManagerInterface
파일 보기 프로젝트 열기: yiisoft/yii2 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$defaultRoles a list of role names that are assigned to every user automatically without calling [[assign()]].

공개 메소드들

메소드 설명
add ( $object )
createPermission ( $name )
createRole ( $name )
getPermission ( $name )
getPermissions ( )
getRole ( $name )
getRoles ( )
remove ( $object )
update ( $name, $object )

보호된 메소드들

메소드 설명
addItem ( Item $item ) : boolean Adds an auth item to the RBAC system.
addRule ( Rule $rule ) : boolean Adds a rule to the RBAC system.
executeRule ( string | integer $user, Item $item, array $params ) : boolean Executes the rule associated with the specified auth item.
getItem ( string $name ) : Item Returns the named auth item.
getItems ( integer $type ) : Item[] Returns the items of the specified type.
removeItem ( Item $item ) : boolean Removes an auth item from the RBAC system.
removeRule ( Rule $rule ) : boolean Removes a rule from the RBAC system.
updateItem ( string $name, Item $item ) : boolean Updates an auth item in the RBAC system.
updateRule ( string $name, Rule $rule ) : boolean Updates a rule to the RBAC system.

메소드 상세

add() 공개 메소드

public add ( $object )

addItem() 추상적인 보호된 메소드

Adds an auth item to the RBAC system.
abstract protected addItem ( Item $item ) : boolean
$item Item the item to add
리턴 boolean whether the auth item is successfully added to the system

addRule() 추상적인 보호된 메소드

Adds a rule to the RBAC system.
abstract protected addRule ( Rule $rule ) : boolean
$rule Rule the rule to add
리턴 boolean whether the rule is successfully added to the system

createPermission() 공개 메소드

public createPermission ( $name )

createRole() 공개 메소드

public createRole ( $name )

executeRule() 보호된 메소드

If the item does not specify a rule, this method will return true. Otherwise, it will return the value of [[Rule::execute()]].
protected executeRule ( string | integer $user, Item $item, array $params ) : boolean
$user string | integer the user ID. This should be either an integer or a string representing the unique identifier of a user. See [[\yii\web\User::id]].
$item Item the auth item that needs to execute its rule
$params array parameters passed to [[CheckAccessInterface::checkAccess()]] and will be passed to the rule
리턴 boolean the return value of [[Rule::execute()]]. If the auth item does not specify a rule, true will be returned.

getItem() 추상적인 보호된 메소드

Returns the named auth item.
abstract protected getItem ( string $name ) : Item
$name string the auth item name.
리턴 Item the auth item corresponding to the specified name. Null is returned if no such item.

getItems() 추상적인 보호된 메소드

Returns the items of the specified type.
abstract protected getItems ( integer $type ) : Item[]
$type integer the auth item type (either [[Item::TYPE_ROLE]] or [[Item::TYPE_PERMISSION]]
리턴 Item[] the auth items of the specified type.

getPermission() 공개 메소드

public getPermission ( $name )

getPermissions() 공개 메소드

public getPermissions ( )

getRole() 공개 메소드

public getRole ( $name )

getRoles() 공개 메소드

public getRoles ( )

remove() 공개 메소드

public remove ( $object )

removeItem() 추상적인 보호된 메소드

Removes an auth item from the RBAC system.
abstract protected removeItem ( Item $item ) : boolean
$item Item the item to remove
리턴 boolean whether the role or permission is successfully removed

removeRule() 추상적인 보호된 메소드

Removes a rule from the RBAC system.
abstract protected removeRule ( Rule $rule ) : boolean
$rule Rule the rule to remove
리턴 boolean whether the rule is successfully removed

update() 공개 메소드

public update ( $name, $object )

updateItem() 추상적인 보호된 메소드

Updates an auth item in the RBAC system.
abstract protected updateItem ( string $name, Item $item ) : boolean
$name string the name of the item being updated
$item Item the updated item
리턴 boolean whether the auth item is successfully updated

updateRule() 추상적인 보호된 메소드

Updates a rule to the RBAC system.
abstract protected updateRule ( string $name, Rule $rule ) : boolean
$name string the name of the rule being updated
$rule Rule the updated rule
리턴 boolean whether the rule is successfully updated

프로퍼티 상세

$defaultRoles 공개적으로 프로퍼티

a list of role names that are assigned to every user automatically without calling [[assign()]].
public $defaultRoles