yii\rbac\ManagerInterface::getPermission PHP Method

getPermission() public method

Returns the named permission.
public getPermission ( string $name ) : null | Permission
$name string the permission name.
return null | Permission the permission corresponding to the specified name. Null is returned if no such permission.
    public function getPermission($name);

Usage Example

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