简体   繁体   中英

rails_admin gem only allow edit action for certain model

i'm using rails_admin gem. In admin page I have a model called Staff. Is possible only allow edit action for this model? I want to disable new,destroy ect ect.

You can use CanCan to configure the authorization in Rails Admin. This wiki tells you how to setup possible verbs for each model.

You could also hack the views to set visibility:hidden etc, but I would prefer the CanCan way.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM