Contacts DB uses a three-tier role system to control what each team member can see and do. Every user is assigned exactly one role —Documentation Index
Fetch the complete documentation index at: https://mintlify.com/0m1n3m/contacts-db/llms.txt
Use this file to discover all available pages before exploring further.
admin, editor, or viewer — stored in the users.role column. The role is checked on every protected route by the RoleMiddleware, which returns a 403 Forbidden response if the user’s role is not in the allowed list. This means you can safely mix roles on a team without worrying about accidental data modification by read-only members.
Roles overview
The table below summarises what each role can do across the four main areas of the application.| Role | Contacts | Tasks | Projects | Admin |
|---|---|---|---|---|
| admin | Full CRUD + bulk delete + import + export | Full CRUD, sees all tasks | Full CRUD | Manage invitations, access /dashboard |
| editor | Create, read, update + export (no delete) | Create, read, update, delete own/assigned tasks | Full CRUD | None |
| viewer | Read-only (list + show) | View + change status on assigned tasks | Read-only | None |
Detailed permissions
Admin — full access
Admin — full access
Admins have unrestricted access to every part of Contacts DB.Contacts
- View, create, edit, and delete individual contacts
- Bulk-delete multiple contacts in one operation
- Import contacts from a CSV file
- Export contacts to CSV
- Create, edit, delete, and change the status of any task
- View all tasks in the system, regardless of who created them or who is assigned
- Create, edit, view, and delete projects
- Send and manage team invitations at
/admin/invitations - Access the
/dashboardroute (shared with editors)
Editor — create and update, no delete
Editor — create and update, no delete
Editors can contribute content but cannot permanently remove contacts or manage team members.Contacts
- View, create, and edit contacts
- Export contacts to CSV
- Cannot delete individual contacts
- Cannot bulk-delete contacts
- Create new tasks and edit existing ones
- Delete tasks
- View tasks they created or are assigned to (the
scopeVisibleToquery scope filters the list automatically — see Managing Tasks for details) - Change task status
- Create, edit, view, and delete projects (full CRUD)
- Cannot send or view invitations
- Can access the
/dashboardroute
Viewer — read-only access
Viewer — read-only access
Viewers have a strictly read-only experience. They can browse data but cannot make any changes.Contacts
- View the contact list and individual contact pages
- Export contacts to CSV
- Cannot create, edit, or delete contacts
- View tasks they are assigned to (the
scopeVisibleToscope hides all other tasks) - Change task status
- Cannot create, edit, or delete tasks
- View projects only
- No access to admin routes or the dashboard
Route middleware
Contacts DB registers the role guard under therole middleware alias. You apply it by passing a colon-separated list of allowed roles. Multiple roles are separated by commas and evaluated with OR logic — the user only needs to match one.
routes/web.php showing how the contact creation route is protected:
RoleMiddleware resolves the authenticated user, normalises role strings to lowercase, and checks whether $user->role is in the allowed list:
->middleware('role')), the middleware allows the request through — this is a developer convenience and should not be relied on for access control.
Assigning roles
Roles are stored in theusers.role string column, which defaults to viewer:
- Seeder — the
AdminUserSeedersets the first user’s role toadminduring initial setup. - Invitations — when an admin sends an invitation they choose the role (admin, editor, or viewer). That role is stored on the
user_invitationsrecord and applied to the new user account the moment the invitation is accepted.
Task visibility scope
Editors and viewers do not see all tasks — thescopeVisibleTo query scope on the Task model filters the result set based on the authenticated user’s role and assignment status. Admins bypass the scope entirely. Refer to Managing Tasks for a full explanation of how the scope is constructed and used.