mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-07-30 04:23:11 +03:00
Added user-interface for "Everyone Else" entity permission item
Nothing on back-end logic done to hook this new option up. Addition of permissions for role_id=0 works out of the box, but active "everyone else" permissions, with no priviliges, is currently not working. Needs change of permission gen logic also.
This commit is contained in:
@ -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>
|
Reference in New Issue
Block a user