【问题标题】:Configuration BjyAuthorize and ZfcUser to work as administrator and a normal user配置 BjyAuthorize 和 ZfcUser 以作为管理员和普通用户工作
【发布时间】:2012-11-14 18:09:03
【问题描述】:

我已经在我的骨架应用程序中安装了这两个模块。两者都在使用他们在此处提供的配置示例https://github.com/bjyoungblood/BjyAuthorize

我还安装了 ZfcAdmin 并向其中添加了一些功能专家。我需要以不低于管理员角色的身份阻止它。已在 db guest、用户 admin 中创建角色

我创建的用户具有管理员角色,这是我的 BjyAuthorize 模块配置文件的一部分

'BjyAuthorize\Guard\Controller' => array(
                array('controller' => 'index', 'action' => 'index', 'roles' => array('guest','user')),
                array('controller' => 'index', 'action' => 'stuff', 'roles' => array('user')),
                array('controller' => 'zfcuser', 'roles' => array()),
                // Below is the default index action used by the [ZendSkeletonApplication](https://github.com/zendframework/ZendSkeletonApplication)
                array('controller' => 'Application\Controller\Index', 'roles' => array('guest', 'user')),
                array('controller' => 'ZfcAdmin\Controller\Admin', 'roles' => array('admin')),
            ),

我已添加具有角色 admin 的控制器“ZfcAdmin\Controller\Admin”,但它仍会阻止管理部分。

非常感谢任何帮助或指导。

【问题讨论】:

    标签: configuration module zend-framework2


    【解决方案1】:

    好的,这只是一个错误的理解,这里的控制器是我们在模块中为控制器定义的可发音键,对于'ZfcAdmin\Controller\Admin',它是'ZfcAdmin\Controller\AdminController'。所以它起作用了。 ..

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-09-30
      • 2021-05-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多