[英]Specific CanCan Abilities for Rails Admin
I am trying to manage some permission in my RailsAdmin, but am having trouble getting it to do exactly what I want to. 我正在尝试在RailsAdmin中管理一些权限,但是无法使其完全按照我的意愿进行操作。
Using the ability file I have some set up. 使用能力文件,我进行了一些设置。 I want to be able to allow a specific kind of user to create, read, trash, export a particular model. 我希望能够允许特定类型的用户创建,读取,删除,导出特定模型。
I decided to change: 我决定更改:
can :manage, Terms, company_id: company_id
to: 至:
can [:create, :read, :trash, :export], Terms, company_id: company_id
thinking that it would still show the little "info" and "delete" icons removing the "edit" icon. 认为它仍然会显示小“信息”和“删除”图标,从而删除“编辑”图标。 Instead it just shows the "info" icon. 相反,它仅显示“信息”图标。
I want the pencil to be gone. 我希望铅笔消失。 Any help or guidance is appreciated. 任何帮助或指导表示赞赏。 I looked at the cancan page and didn't get much help. 我看着康康页面,却没有得到太多帮助。
Below: 下面:
can :manage, Terms, company_id: company_id
I added: 我补充说:
cannnot :update, Terms, company_id: company_id
which seemed to work properly 这似乎正常工作
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.