Appearance
Return
Using user roles
Control what users can see and do by assigning roles and checking them in your app.
Steps at a glance ​
- Create roles in
Data & API → Auth. - Assign roles to users.
- Use roles to protect pages and APIs.
1) Create roles ​
- Open
Data & API → Auth. - Go to
Roles. - Create roles that match your needs (for example
admin,member).
2) Assign roles to users ​
- Open
Data & API → Auth → Users. - Select a user.
- Assign the appropriate roles.
3) Use roles in your app ​
- Protect pages so only certain roles can open them.
- Secure APIs with
Middlewareso only allowed roles can access sensitive data.
Common pitfalls ​
A user is signed in but still blocked ​
- Confirm they actually have the role assigned.
- Confirm the page or API is checking the same role name.

