/** * 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')); } }
/** * @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')]; }
/** * @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')]; }
/** * @inheritdoc */ public function attributeLabels() { return ['name' => Module::t('rbac', 'BACKEND_RULES_ATTR_NAME'), 'namespace' => Module::t('rbac', 'BACKEND_RULES_ATTR_NAMESPACE')]; }