Skip to content
This repository has been archived by the owner on Nov 30, 2022. It is now read-only.

Latest commit

 

History

History
18 lines (11 loc) · 1017 Bytes

permissions.md

File metadata and controls

18 lines (11 loc) · 1017 Bytes

Permissions

Permissions for users are handled through Pundit. Every controller/view/model has authorization calls controlled by Pundit policies.

The policies will allow anyone who's in the "Admins" group to have access to everything. The policies will then check user's permissions from the database to see if they are granted access, it will then also traverse over the user's groups permissions from the database to see if the group is granted access.

Permissions for the policies are stored in the database as such:

  • resource (controller/model class name, example: "Guts::Type")
  • grant (method for resource, example: "index", "destroy")
  • permissionable (polymorphic object, example: "Guts::User")

Permission is polymorphic... each user can have many permissions and each user group can have many permissions.

Overriding & Extending

See doc/extra/extending_guts.md for how to override policies.

Read more at Pundit's GitHub page for working with policies.