使用具有声明性授权和 Authlogic 的管理仪表板?

发布于 2024-08-25 18:01:47 字数 374 浏览 7 评论 0原文

我使用声明性授权和 Authlogic,现在想要创建一个用于管理的仪表板。关于ActiveScaffold 将显示不同控制器的概述。

但是,我有一个问题,我无法管理子文件夹的“管理员权限” 应用程序/控制器/管理/admin_controller。我怎样才能做到这一点?

目前我的 Authorization_rules.rb 看起来像这样:

authorization do
    role :admin do
      includes :guest
      has_permission_on :admin,     :to => [:index]
    end
end

但这不起作用!有人可以帮助我吗? 谢谢

I use Declarative Authorization and Authlogic and now wants to create a dashboard for the administration. About ActiveScaffold will be an overview of the different controllers are shown.

However, I have the problem that I can admin no "admin rights" to the subfolders
app/controllers/admin/admin_controller. How can I do that?

Currently my Authorization_rules.rb looks like this:

authorization do
    role :admin do
      includes :guest
      has_permission_on :admin,     :to => [:index]
    end
end

But that does not work! Can someone help me?
Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

心病无药医 2024-09-01 18:01:47

几分钟后我解决了这个问题。
如果您想为子文件夹添加规则,则必须如下所示:
admin/admin_controller 的规则:

role :admin do 
  has_permissions_on :admin_admin, :to=>[:index] 
end 

I solve this some minutes later.
If you want to add rules for subfolders you must something like this:
rule for admin/admin_controller:

role :admin do 
  has_permissions_on :admin_admin, :to=>[:index] 
end 
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文