I have a User model, but I would like another model ( Client
) to have unique authorization access to a particular action of another controller.
I do not want the Client model to access an action in the Client
controller. I want the Client
model to access the compare
action of the stages
controller.
How do I do that ?
Edit1: I should have specified. I have devise & decl_auth already installed. But devise & decl_auth are managing my Users
. I need to have more authorization rules for another model outside of the Users
model.
If you set up CanCan, this should be a fairly easy thing to do. Here's a link to the RailsCast showing how something like this can be done, http://railscasts.com/episodes/192-authorization-with-cancan .
Extensive docs are here: https://github.com/ryanb/cancan/wiki
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.