]> BookStack Code Mirror - bookstack/blobdiff - resources/views/form/entity-permissions-row.blade.php
Added user-interface for "Everyone Else" entity permission item
[bookstack] / resources / views / form / entity-permissions-row.blade.php
index bff7315a0caf24dc3d1db3e7fe4ee949b72e51a6..f8c1dc1c7ac7a0f25c454ab47e12f42b25d398e8 100644 (file)
@@ -1,28 +1,46 @@
 <div component="permissions-table" class="content-permissions-row flex-container-row justify-space-between wrap">
-    <div class="content-permissions-row-label gap-x-m flex-container-row items-center px-l py-m flex">
-        <div class="text-large" title="{{ trans('common.role') }}">
-            @icon('role')
+    <div class="gap-x-m flex-container-row items-center px-l py-m flex">
+        <div class="text-large" title="{{ $role->id === 0 ? 'Everyone Else' : trans('common.role') }}">
+            @icon($role->id === 0 ? 'groups' : 'role')
         </div>
-        <span>{{ $role->display_name }}</span>
-        <button type="button"
+        <span>
+            <strong>{{ $role->display_name }}</strong> <br>
+            <small class="text-muted">{{ $role->description }}</small>
+        </span>
+        @if($role->id !== 0)
+            <button type="button"
                 class="ml-auto flex-none text-small text-primary text-button hover-underline content-permissions-row-toggle-all hide-under-s"
                 refs="permissions-table@toggle-all"
-                >{{ trans('common.toggle_all') }}</button>
+                ><strong>{{ trans('common.toggle_all') }}</strong></button>
+        @endif
     </div>
+    @php
+        $inheriting = ($role->id === 0 && !$model->restricted);
+    @endphp
+    @if($role->id === 0)
+        <div class="px-l flex-container-row items-center" refs="entity-permissions@everyoneInherit">
+            @include('form.custom-checkbox', [
+                'name' => 'entity-permissions-inherit',
+                'label' => 'Inherit defaults',
+                'value' => 'true',
+                'checked' => $inheriting
+            ])
+        </div>
+    @endif
     <div class="flex-container-row justify-space-between gap-x-xl wrap items-center">
         <div class="px-l">
-            @include('form.restriction-checkbox', ['name'=>'restrictions', 'label' => trans('common.view'), 'action' => 'view'])
+            @include('form.restriction-checkbox', ['name'=>'restrictions', 'label' => trans('common.view'), 'action' => 'view', 'disabled' => $inheriting])
         </div>
         <div class="px-l">
             @if(!$model instanceof \BookStack\Entities\Models\Page)
-                @include('form.restriction-checkbox', ['name'=>'restrictions', 'label' => trans('common.create'), 'action' => 'create'])
+                @include('form.restriction-checkbox', ['name'=>'restrictions', 'label' => trans('common.create'), 'action' => 'create', 'disabled' => $inheriting])
             @endif
         </div>
         <div class="px-l">
-            @include('form.restriction-checkbox', ['name'=>'restrictions', 'label' => trans('common.update'), 'action' => 'update'])
+            @include('form.restriction-checkbox', ['name'=>'restrictions', 'label' => trans('common.update'), 'action' => 'update', 'disabled' => $inheriting])
         </div>
         <div class="px-l">
-            @include('form.restriction-checkbox', ['name'=>'restrictions', 'label' => trans('common.delete'), 'action' => 'delete'])
+            @include('form.restriction-checkbox', ['name'=>'restrictions', 'label' => trans('common.delete'), 'action' => 'delete', 'disabled' => $inheriting])
         </div>
     </div>
 </div>
\ No newline at end of file