@if ($isSystem)
{{ __('System role permissions are locked and cannot be modified.') }}
@endif
@foreach ($permissionGroups as $group)
@if (!empty($group['section']))
{{ __($group['section']) }}
@elseif (!empty($group['inline']))
@php $inlinePerms = array_values($group['permissions']); $inlineKeys = array_keys($group['permissions']); @endphp
{{ __($group['inline']) }}
@foreach ($allVerbs as $vIndex => $verb)
@if (isset($inlineKeys[$vIndex]))
@endif
@endforeach
@elseif (!empty($group['fixed']))
@foreach ($group['fixed'] as $fixedPermission)
{{ __($fixedPermission) }}
@foreach ($allVerbs as $verb)
@if ($loop->last)
@endif
@endforeach
@endforeach
@else
@php
$resource = $group['resource'];
$verbs = $group['verbs'];
$allPerms = array_map(fn($v) => $v . ' ' . $resource, $verbs);
$allPermsJs = json_encode($allPerms);
$manageKey = 'manage ' . $resource;
$rowLocked = $isSystem && empty($group['unlocked']);
@endphp
@endif
@endforeach