Я новичок в yii. Я установил yii-права в защищенных/modules/правах согласно документации. Но нельзя использовать правильно. Что-то не хватает, что я не мог узнать. localhost/index.php/правая страница работает хорошо. Но когда я нажимаю «разрешения», «роли», «задачи», «операции». Он показываетYii Rights :: Ошибка 403 Вы не авторизованы для выполнения этого действия
«Ошибка 403 У вас нет прав для совершения этого действия».
Вот моя основная конфигурация ::
'import'=>array(
'application.modules.right.*',
'application.modules.right.models*',
'application.modules.rights.components.*',
),
'rights'=>array(
'superuserName'=>'Admin', // Name of the role with super user privileges.
'authenticatedName'=>'Authenticated', // Name of the authenticated user role.
'userIdColumn'=>'id', // Name of the user id column in the database.
'userNameColumn'=>'username', // Name of the user name column in the database.
'enableBizRule'=>true, // Whether to enable authorization item business rules.
'enableBizRuleData'=>false, // Whether to enable data for business rules.
'displayDescription'=>true, // Whether to use item description instead of name.
'flashSuccessKey'=>'RightsSuccess', // Key to use for setting success flash messages.
'flashErrorKey'=>'RightsError', // Key to use for setting error flash messages.
'baseUrl'=>'/rights', // Base URL for Rights. Change if module is nested.
'layout'=>'rights.views.layouts.main', // Layout to use for displaying Rights.
'appLayout'=>'application.views.layouts.main', // Application layout.
'cssFile'=>'rights.css', // Style sheet file to use for Rights.
'install'=>false, // Whether to enable installer.
'debug'=>false,
),
'components'=>array(
'user'=>array(
'class'=>'RWebUser',
// enable cookie-based authentication
'allowAutoLogin'=>true,
'loginUrl'=>array('/user/login'),
),
AssignementController
public function accessRules()
{
return array(
array('allow', // Allow superusers to access Rights
'actions'=>array(
'view',
'user',
'revoke',
),
'users'=>$this->_authorizer->getSuperusers(),
),
array('deny', // Deny all users
'users'=>array('*'),
),
);
}
мне нужна ваша помощь. ПОЖАЛУЙСТА,
Обратите внимание: :: Я также использую yii-user. yii-user работает хорошо.
Это не работает ::: my controller :: 'actions' => array ('view', 'user', 'revoke',), 'users' => $ this -> _ authorizer-> getSuperusers() , –
, пожалуйста, помогите мне с правильным решением. Я не смог это исправить –