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
ファイル: RoleController.php プロジェクト: wsdslm/yii2-rbac
 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