Roles and permissions
Give your users different kinds of access, and understand where that access is actually enforced.
A role is a kind of user. A shop has buyers and staff; a school has students and teachers; a company tool has everyone and the admins.
When you need them#
Only when there are genuinely different kinds of people. If every user of your app does the same things, roles add a field nobody fills in and a decision nobody needs.
There are two kinds of user: customers, who see their own orders, and staff, who see all orders and can change the status.That sentence is enough. It names the roles and says what each one can do, which is the part that matters.
Where roles are enforced#
On the server, not in the browser.
This distinction is the whole point. Hiding a button stops someone clicking it; it does not stop them asking the server directly. YeshBe checks the role on every read and write, so a customer asking for another customer's order gets nothing back — whatever they send.
Changing someone's role#
In the Users tab, each row has a role picker. Changing it takes effect on their next request.
The first account in an app is usually the one you want as an admin, and you can set that there.
Roles and payment plans#
A role and a paid plan are different things, and it's worth keeping them separate.
A role is what kind of user someone is. A plan is what they've paid for. A staff member and a customer are different roles; a customer on Basic and a customer on Pro are the same role with different entitlements.
If what you need is "this feature is only for paying customers", that is a plan rather than a role, and it belongs with however you handle paying customers — not in the role field.
Next#
- Managing users Change roles, block accounts, export the list.
- App data API Read and change users from your own code.