RbacHelper.php
public static function createChildPermission($role, $name, $description)
    {
        // Create permission with a given name and description and add it to RBAC system
        $auth = Yii::$app->authManager;
        $permission = $auth->createPermission($name);
        $permission->description = $description;
        $auth->add($permission);

        // Add this permission to a given role
        $auth->addChild($role, $permission);

        return $permission;
    }
public static function createChildPermission($role, $name, $description)
    {
        // Create permission with a given name and description and add it to RBAC system
        $auth = Yii::$app->authManager;
        $permission = $auth->createPermission($name);
        $permission->description = $description;
        $auth->add($permission);

        // Add this permission to a given role
        $auth->addChild($role, $permission);

        return $permission;
    }
public static function createChildPermission ( $ role , $ name , $ description ) { // Create permission with a given name and description and add it to RBAC system $ auth = Yii :: $ app -> authManager ; $ permission = $ auth -> createPermission ( $ name ) ; $ permission -> description = $ description ; $ auth -> add ( $ permission ) ; // Add this permission to a given role $ auth -> addChild ( $ role , $ permission ) ; return $ permission ; }
Creates permission with a given name and description and adds it to RBAC system,
assigning permission to the role.
@param Role $role
@param string $name
@param string $description
@return Permission
Creates permission with a given name and description and adds it to RBAC system assigning permission to the role .