0

I am using Rails(4.2.1), Devise(3.4.1) and Pundit(1.0.0) and want to restrict the access to devise views(such as /users/edit) by my users role(rolify, 4.0.0).

How my policy should be named or how do I specify which model is referring to ? to match devise's

I tried to copy the devise controllers with a script in the docs but can't make it work.

What should I do to make this work, couldn't find anything that explain how to do this in a simple way. Just to be sure I am trying to use devise default views

Cassio Cabral
  • 2,652
  • 3
  • 23
  • 37

1 Answers1

-1

I can recommend this screencast for you: Authorization with Pundit

You can name your policies like your model. For example for the Post model it's PostPolicy.

It's always informative to look at the readme: Pundit Readme

crispychicken
  • 2,592
  • 2
  • 33
  • 50
  • Unfortunately this screencast it is not free, and my problem is not with Pundit only, it is about its integration with Devise. I read the docs and understood the Post example, but couldn't get to work with Devise user. – Cassio Cabral Apr 23 '15 at 18:03
  • If you need more help you can post your code to your question. – crispychicken Apr 24 '15 at 06:32
  • Sorry, I can't. Either way, I am hoping for someone that did something like this before to answer or give some direction. – Cassio Cabral Apr 24 '15 at 13:34