@extends('layouts.app') @section('title', $role->exists ? 'Edit role' : 'New role') @section('content')
@csrf @if ($role->exists) @method('PUT') @endif
@foreach ($catalogue as $group => $permissions)
@foreach ($permissions as $permission) @php $holds = auth()->user()->isTenantOwner() || array_key_exists($permission->key, $held); $myScope = $held[$permission->key] ?? 'tenant'; $rank = ['own' => 1, 'team' => 2, 'tenant' => 3]; $ceiling = auth()->user()->isTenantOwner() ? 3 : ($rank[$myScope] ?? 0); @endphp @endforeach
PermissionScope
{{ $permission->label }} {{ $permission->key }} @if (! $holds) {{-- Offering a control that would be refused on submit is worse than not offering it. --}} You do not hold this @else @endif
@endforeach
Cancel
@endsection