示例#1
0
 /**
  * Find permission by name.
  *
  * @param string $name Permission name
  *
  * @return \yii\rbac\Permission Permission
  *
  * @throws HttpException 404 error if role not found
  */
 protected function findPermission($name)
 {
     if (($model = Yii::$app->authManager->getPermission($name)) !== null) {
         return $model;
     } else {
         throw new HttpException(404, Module::t('rbac', 'BACKEND_PERMISSIONS_NOT_FOUND'));
     }
 }
示例#2
0
 /**
  * @inheritdoc
  */
 public function attributeLabels()
 {
     return ['name' => Module::t('rbac', 'BACKEND_PERMISSIONS_ATTR_NAME'), 'ruleName' => Module::t('rbac', 'BACKEND_PERMISSIONS_ATTR_RULE_NAME'), 'description' => Module::t('rbac', 'BACKEND_PERMISSIONS_ATTR_DESCRIPTION'), 'data' => Module::t('rbac', 'BACKEND_PERMISSIONS_ATTR_DATA'), 'children' => Module::t('rbac', 'BACKEND_PERMISSIONS_ATTR_CHILDREN')];
 }
示例#3
0
文件: Role.php 项目: cjq/QRCode-yii2
 /**
  * @inheritdoc
  */
 public function attributeLabels()
 {
     return ['name' => Module::t('rbac', 'BACKEND_ROLES_ATTR_NAME'), 'ruleName' => Module::t('rbac', 'BACKEND_ROLES_ATTR_RULE_NAME'), 'description' => Module::t('rbac', 'BACKEND_ROLES_ATTR_DESCRIPTION'), 'data' => Module::t('rbac', 'BACKEND_ROLES_ATTR_DATA'), 'rolesChildren' => Module::t('rbac', 'BACKEND_ROLES_ATTR_ROLES'), 'permissionsChildren' => Module::t('rbac', 'BACKEND_ROLES_ATTR_PERMISSIONS')];
 }
示例#4
0
文件: Rule.php 项目: cjq/QRCode-yii2
 /**
  * @inheritdoc
  */
 public function attributeLabels()
 {
     return ['name' => Module::t('rbac', 'BACKEND_RULES_ATTR_NAME'), 'namespace' => Module::t('rbac', 'BACKEND_RULES_ATTR_NAMESPACE')];
 }