Commit c15edf88 authored by Mahmoud Aglan's avatar Mahmoud Aglan

Add permission matrix page for visual role-permission management

New /roles/matrix page shows all permissions as rows grouped by module
with Arabic labels, all roles as columns, and color-coded scope badges
(own/branch/academy/all). Includes module and role filtering, stats
per role, and click-to-cycle scope for custom roles. System roles are
read-only. Accessible from the roles list page via "المصفوفة" button.
Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
parent ea896bb3
This diff is collapsed.
This diff is collapsed.
<div> <div>
<div class="flex flex-col sm:flex-row sm:items-center justify-between gap-3 mb-4 sm:mb-6"> <div class="flex flex-col sm:flex-row sm:items-center justify-between gap-3 mb-4 sm:mb-6">
<h1 class="text-xl sm:text-2xl font-bold text-gray-800">الأدوار والصلاحيات</h1> <h1 class="text-xl sm:text-2xl font-bold text-gray-800">الأدوار والصلاحيات</h1>
@can('roles.create') <div class="flex items-center gap-2">
<a href="{{ route('roles.create') }}" wire:navigate <a href="{{ route('roles.matrix') }}" wire:navigate
class="inline-flex items-center gap-2 px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 text-sm font-medium"> class="inline-flex items-center gap-2 px-4 py-2 border border-gray-300 text-gray-700 rounded-lg hover:bg-gray-50 text-sm font-medium">
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4v16m8-8H4"/></svg> <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2V6zM14 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2V6zM4 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2v-2zM14 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2v-2z"/></svg>
<span class="hidden sm:inline">إضافة دور</span> <span class="hidden sm:inline">{{ __('المصفوفة') }}</span>
</a> </a>
@endcan @can('roles.create')
<a href="{{ route('roles.create') }}" wire:navigate
class="inline-flex items-center gap-2 px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 text-sm font-medium">
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4v16m8-8H4"/></svg>
<span class="hidden sm:inline">إضافة دور</span>
</a>
@endcan
</div>
</div> </div>
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3 sm:gap-4"> <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3 sm:gap-4">
......
...@@ -165,6 +165,8 @@ ...@@ -165,6 +165,8 @@
// Roles // Roles
Route::get('/roles', \App\Livewire\Roles\RoleList::class)->name('roles.list') Route::get('/roles', \App\Livewire\Roles\RoleList::class)->name('roles.list')
->middleware('permission:roles.list'); ->middleware('permission:roles.list');
Route::get('/roles/matrix', \App\Livewire\Roles\PermissionMatrix::class)->name('roles.matrix')
->middleware('permission:roles.list');
Route::get('/roles/create', \App\Livewire\Roles\RoleForm::class)->name('roles.create') Route::get('/roles/create', \App\Livewire\Roles\RoleForm::class)->name('roles.create')
->middleware('permission:roles.create'); ->middleware('permission:roles.create');
Route::get('/roles/{role}/edit', \App\Livewire\Roles\RoleForm::class)->name('roles.edit') Route::get('/roles/{role}/edit', \App\Livewire\Roles\RoleForm::class)->name('roles.edit')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment