Breadcrumbs
User Roles
Learn How to Use User Roles in Your NextKit App
The NextKit Starter has three default roles:
We use an enum
, but you can convert this to an object if you need more granular permissions.
The permissions are hierarchical, which means that if we had a role with a lower level (Readonly
), we would add it before Member
:
When writing permissions between users, we can check if the user performing the action has a greater role than the target user.
You can extend the role above easily by adding your own, for example:
Afterward, remember to add the name and descriptions of these roles in the translations file common.json
:
Learn more about using user roles in your permissions system.
The role is stored in the database as a column in the memberships
tabel.