A Payload site, ready to clone

A user’s account: Roles, then Admin Settings with the admin language and theme

Roles and permissions: one function decides

Five roles that combine

A person holds one or more of five roles: editor, publisher, site manager, user manager and admin. What they may do is everything their roles allow together. Editors write drafts, publishers publish, site managers run redirects, menus, forms, authors and the settings, user managers manage users, and admins can do everything. The first user created on an empty site becomes an admin.

One place that knows the roles

Every permission check goes through src/lib/permissions.ts, the only code that reads a user’s role. Access rules in collections and hooks ask it, and none compares role names itself. The grants are data in src/lib/roles.ts, and a project can add roles of its own in its project configuration.

Users and roles, in the demo

What each role can and cannot do.

Open Users and roles