Role-Based Permissions Management

Role-Based Permission System

Permissions are now managed by user roles and lawyer levels. Each role has predefined permissions that apply to all users with that role. This ensures consistent access control and easier management.

@foreach($rolePermissions as $roleKey => $roleData)

{{ $roleData['label'] }}

{{ $userCounts[$roleKey] ?? 0 }} users
{{ count($roleData['permissions']) }} permissions
@if(count($roleData['permissions']) > 0)
@foreach(array_slice($roleData['permissions'], 0, 3) as $permission) {{ str_replace('.', ' ', $permission) }} @endforeach @if(count($roleData['permissions']) > 3) +{{ count($roleData['permissions']) - 3 }} more @endif
@else No permissions @endif
@endforeach

Detailed Permissions Matrix

Complete overview of permissions by role and category

@foreach($rolePermissions as $roleKey => $roleData) @endforeach @foreach($permissionCategories as $category => $permissions) @foreach($rolePermissions as $roleKey => $roleData) @endforeach @endforeach
Permission Category
{{ $roleData['label'] }}
{{ $category }}
{{ implode(', ', array_map(function($p) use ($category) { return str_replace($category === 'Global' ? 'global.' : strtolower($category) . '.', '', $p); }, $permissions)) }}
@php $hasAnyPermission = false; foreach($permissions as $permission) { if(in_array($permission, $roleData['permissions'])) { $hasAnyPermission = true; break; } } @endphp @if($hasAnyPermission)
@foreach($permissions as $permission) @if(in_array($permission, $roleData['permissions'])) @endif @endforeach
@else @endif

Legend & Notes

Has Permission
No Permission

Note: Permissions are automatically assigned based on user roles. Superadmins have all permissions. To change a user's permissions, update their role in the user management section.

{{-- Alert Component --}}