Skip to content

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

  1. Navigate to Settings > Users in the Admin sidebar.
  2. Click Edit on a specific user (or create a new one).
  3. In the Role dropdown, select the appropriate access level.
  4. Click Save.

Step 3: Extend Permissions (Advanced)

To create custom roles or granular permissions beyond the defaults:

  1. Use the Spatie CLI or code to create a new permission:
    bash
    php artisan permission:create-permission "edit invoices"
  2. Assign it to a role in your AuthServiceProvider or via a custom admin UI.
  3. 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.

Released under the MIT License.