Yii权限::无法使用定义的角色访问控制器操作
我已与Yii用户成功安装Yii权限模块 我有:-Yii权限::无法使用定义的角色访问控制器操作,yii,yii-extensions,Yii,Yii Extensions,我已与Yii用户成功安装Yii权限模块 我有:- 创建一个角色(已验证) 授予特定控制器的权限。操作(活动索引) 但是,当我作为“已验证”角色登录到系统时(我确信权限在登录中正常工作,因为我通过角色重定向用户),Campaign.index返回错误403->您无权执行此操作 然而,当“管理员”角色进入控制器时,它工作得很好。我注意到有一种方法允许用户使用allowedaction()进入控制器,但当我注销并输入函数时,它会显示出来。因此,这不是一个解决办法 在我的控制器中,我有 class Ca
class CampaignController extends RController {
/**
* @var string the default layout for the views. Defaults to '//layouts/column2', meaning
* using two-column layout. See 'protected/views/layouts/column2.php'.
*/
public $layout = '//client/dashboard';
/**
* @return array action filters
*/
public function filters() {
return array(
'rights', // perform access control for CRUD operations
//'postOnly + delete', // we only allow deletion via POST request
);
}
/**
* Specifies the access control rules.
* This method is used by the 'accessControl' filter.
* @return array access control rules
*/
public function accessRules() {
return array(
array('allow', // allow all users to perform 'index' and 'view' actions
'actions' => array('index', 'view', 'create', 'update'),
'users' => array('@'),
),
array('allow', // allow admin user to perform 'admin' and 'delete' actions
'actions' => array('admin', 'delete'),
'users' => array('admin'),
),
array('deny', // deny all users
'users' => array('*'),
),
);
}
我已经阅读了大部分关于这个主题的网页,但是我发现没有一个像我一样有同样的问题。我已尝试卸载该模块,并重新安装,但没有运气
Im使用Yii 1.1.14和从下载的最新Yii权限(最新更新日期2014-02-20)
请帮我定义我的问题
谢谢。:) 尝试在函数filters()中将“accessRules”添加到数组中好的,我找到了一个解决方案。这是因为我的控制器在一个文件夹中。例如,protected/controller/client/activecontroller.php。我需要在权限内提供我的文件夹名称,例如:client/Campaign.index,以使其正常工作。无论如何,在找到解决方案两天后,这真的是值得的