I am working on a Rails App that uses Devise as the authentication module, however I want to customize it so that CanCan will only permit Administrators to create a new user. I am having a hard time understanding how to customize the controller for Devise so that this can be done. Any help would be appreciated.
Share
You can create a “User” controller that will manage users and then simply set permissions for it. So in your new User controller you can have something like:
Assuming you have administrators set to:
You should be good to go.
In your routes file you’ll need to set up your routes:
Hope this helps!