yii\rbac\ManagerInterface::addChild PHP Method

addChild() public method

Adds an item as a child of another item.
public addChild ( Item $parent, Item $child ) : boolean
$parent Item
$child Item
return boolean whether the child successfully added
    public function addChild($parent, $child);

Usage Example

Example #1
0
 public function actionAjaxChild($name)
 {
     $role = $this->findRole($name);
     $namePermission = Yii::$app->request->post('permission');
     $permission = $this->auth->getPermission($namePermission);
     return $this->auth->addChild($role, $permission) ? 'success' : 'fail';
 }
All Usage Examples Of yii\rbac\ManagerInterface::addChild