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
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$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