Closed srb- closed 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.
@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").
User
record in rails console
to grant the user with the permission (if we were trying to test on localhost)@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 inrails 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.
pundit
gemaircraft
creationcontext
field on theUser
objectshow
view to have policy-dependent behaviorwing_admin
so we can easily toggle users in and out of admin to check permissionsTesting: