Need help on Handling unauthorized user using petergate

7 views
Skip to first unread message

Uzval Mallepeddi

unread,
Jan 9, 2020, 1:53:52 AM1/9/20
to Ruby on Rails: Talk

Imagine a testcase where a specific controller has access privileges for its actions.
Let's say there's a controller "Test" and it has actions like "show", "new", "create" and i created an access privilege using petergate for different roles.
access user: [show], admin: [new create]
The test case that's bugging me is that what if the user is NOT AUTHENTICATED and want to access a page of this "Test" controller ??
I tried to create a replica of "Test" contoller, create new views for it and on form submission, i tried to push the form data into the "Test" model. But it's not allowing me to do so as Test controller is linked to Test model.

Need help on this !

Reply all
Reply to author
Forward
0 new messages