protector-cancan:Protector 和 CanCan 之间的集成层

时间:2021-06-09 01:04:39
【文件属性】:
文件名称:protector-cancan:Protector 和 CanCan 之间的集成层
文件大小:13KB
文件格式:ZIP
更新时间:2021-06-09 01:04:39
Ruby 保护者::康康 集成和 。 Protector 和 CanCan 都差不多:访问控制。 然而,它们在不同方面发挥作用:Protector 在模型级别上工作,而 CanCan 则是关于控制器防御。 有了这款宝石,您无需再选择:让它们协同工作以获得最佳效果。 集成使 CanCan 意识到 Protector 限制。 您仍然可以拥有单独的Ability实例,甚至可以扩展(或覆盖)来自 Protector 的内容。 此外,CanCan 将在load_resource部分使用current_user自动限制实例。 安装 预计此时您已具备 CanCan 能力。 如果没有,请继续使用制作一个。 将此行添加到应用程序的 Gemfile 中: gem 'protector-cancan' 然后执行: $ bundle 现在按以下方式修改您的Ability定义: class Abilit
【文件预览】:
protector-cancan-master
----.gitignore(154B)
----.rspec(32B)
----LICENSE.txt(1KB)
----spec()
--------lib()
--------controllers()
--------spec_helpers()
--------internal()
----README.md(3KB)
----lib()
--------protector()
----protector-cancan.gemspec(916B)
----Gemfile(402B)
----Rakefile(140B)

网友评论