feat(permissions): full permission catalogue grouped by section

- Migration: add 'group' and 'description' columns to the permissions table.
- PermissionCatalogSeeder (idempotent updateOrCreate): full catalogue across 11
  sections — Proyectos, Fases y progreso, Capas y elementos, Inspecciones,
  Incidencias, Empresas, Usuarios, Roles, Informes, Archivos, General. Sets
  group + description on existing and creates the new ones; does NOT touch role
  assignments. Registered in DatabaseSeeder.
- RoleView: group permission toggles by the 'group' column in a defined section
  order and show each permission's description.
DB updated locally (migrate + seed run).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-17 17:32:16 +02:00
parent 5587026446
commit 433c15a183
5 changed files with 145 additions and 4 deletions
@@ -110,9 +110,14 @@
<div class="grid grid-cols-1 sm:grid-cols-2 gap-x-8 gap-y-2">
@foreach($perms as $perm)
<label class="flex items-center justify-between gap-3 cursor-pointer py-1">
<span class="text-sm">{{ $perm->name }}</span>
<div class="min-w-0">
<span class="text-sm">{{ $perm->name }}</span>
@if($perm->description)
<p class="text-xs text-gray-400 leading-tight">{{ $perm->description }}</p>
@endif
</div>
<input type="checkbox"
class="toggle toggle-primary toggle-sm"
class="toggle toggle-primary toggle-sm shrink-0"
wire:key="perm-{{ $role->id }}-{{ $perm->id }}"
@checked(in_array($perm->name, $rolePerms, true))
wire:click="togglePermission('{{ $perm->name }}')" />