pJeyakumar / noticed_upgrade_project

2 stars 0 forks source link

Add Authorization using Pundit #28

Closed srb- closed 5 months ago

srb- commented 5 months ago

Testing:

srb- commented 5 months ago

I'm wondering if Pundit is even needed, as now that I can browse the the app's source, it doesn't look like policies are ever applied directly to noticed classes? But I could be wrong.

pJeyakumar commented 5 months ago

@srb- it would be useful to have a toggle in the /users/:id/edit page to allow us to grant the user the necessary permissions in the policy (e.g. "app:dispatch:wing_admin").

srb- commented 5 months ago

@srb- it would be useful to have a toggle in the /users/:id/edit page to allow us to grant the user the necessary permissions in the policy (e.g. "app:dispatch:wing_admin").

  • instead of having to manually update the User record in rails console to grant the user with the permission (if we were trying to test on localhost)

Good suggestion. I added an 'admin' virtual attribute in the User views... I didn't bother adding it to the Devise views - happy to do so if people think it'd be helpful.