mongodb\rbac\MongoDbManager assign()

assign() public method Assigns a role to a user. public yii\rbac\Assignment assign ( $role, $userId )$role yii\rbac\Role $userId string|integer The user ID (see yii\web\User::$id) return yii\rbac\Assignment The role assignment information. throws Exception if the role has already been assigned to the user

mongodb\rbac\MongoDbManager addRule()

addRule() protected method Adds a rule to the RBAC system. protected boolean addRule ( $rule )$rule yii\rbac\Rule The rule to add return boolean Whether the rule is successfully added to the system throws Exception if data validation or saving fails (such as the name of the rule is not unique)

mongodb\rbac\MongoDbManager addItem()

addItem() protected method Adds an auth item to the RBAC system. protected boolean addItem ( $item )$item yii\rbac\Item The item to add return boolean Whether the auth item is successfully added to the system throws Exception if data validation or saving fails (such as the name of the role or permission is not unique)

mongodb\rbac\MongoDbManager addChild()

addChild() public method Adds an item as a child of another item. public boolean addChild ( $parent, $child )$parent yii\rbac\Item $child yii\rbac\Item return boolean Whether the child successfully added throws yii\base\Exception if the parent-child relationship already exists or if a loop has been detected.

mongodb\rbac\MongoDbManager $rules

$rules protected read-only property All auth rules (name => Rule) public yii\rbac\Rule[] getRules ( )

mongodb\rbac\MongoDbManager $ruleCollection

$ruleCollection public property The name of the collection storing rules. Defaults to "auth_rule". public string|array $ruleCollection = 'auth_rule'

mongodb\rbac\MongoDbManager $items

$items protected property All auth items (name => Item) protected yii\rbac\Item[] $items = null

mongodb\rbac\MongoDbManager $itemCollection

$itemCollection public property The name of the collection storing authorization items. Defaults to "auth_item". public string|array $itemCollection = 'auth_item'

mongodb\rbac\MongoDbManager $db

$db public property The MongoDB connection object or the application component ID of the MongoDB connection. After the MongoDbManager object is created, if you want to change this property, you should only assign it with a MongoDB connection object. public yii\mongodb\Connection|array|string $db = 'mongodb'

mongodb\rbac\MongoDbManager $cacheKey

$cacheKey public property The key used to store RBAC data in cache See also $cache. public string $cacheKey = 'rbac'