Define Roles and Permissions
Kompass uses a role-based access control (RBAC) system — powered by Spatie Laravel Permission — to control what users can see and do in the admin dashboard.
Step 1: Understand Default Roles
Kompass ships with four predefined roles:
- Administrator: Complete access to all tools, settings, and code-level configurations.
- Manager: Can manage content (pages/posts), media, and some tools.
- Editor: Can create and edit content but cannot access system settings.
- User: Basic access for front-facing registered users.
Step 2: Assign a Role to a User
- Navigate to Settings > Users in the Admin sidebar.
- Click Edit on a specific user (or create a new one).
- In the Role dropdown, select the appropriate access level.
- Click Save.
Step 3: Extend Permissions (Advanced)
To create custom roles or granular permissions beyond the defaults:
- Use the Spatie CLI or code to create a new permission:bash
php artisan permission:create-permission "edit invoices" - Assign it to a role in your
AuthServiceProvideror via a custom admin UI. - Guard your custom features in Blade:blade
@can('edit invoices') <!-- Invoice editing tools --> @endcan
Do Not Modify the Administrator Role
Avoid modifying the default Administrator role — many core system checks rely on it being present with full access.