2022-10-10 19:24:23 +08:00
|
|
|
{{--
|
|
|
|
$role - The Role to display this row for.
|
|
|
|
$entityType - String identifier for type of entity having permissions applied.
|
|
|
|
$permission - The entity permission containing the permissions.
|
2022-10-11 00:22:38 +08:00
|
|
|
$inheriting - Boolean if the current row should be marked as inheriting default permissions. Used for "Everyone Else" role.
|
2022-10-10 19:24:23 +08:00
|
|
|
--}}
|
|
|
|
|
2022-10-29 22:23:21 +08:00
|
|
|
<div component="permissions-table" class="item-list-row flex-container-row justify-space-between wrap">
|
2022-10-03 01:09:48 +08:00
|
|
|
<div class="gap-x-m flex-container-row items-center px-l py-m flex">
|
2022-10-11 22:52:56 +08:00
|
|
|
<div class="text-large" title="{{ $role->id === 0 ? trans('entities.permissions_role_everyone_else') : trans('common.role') }}">
|
2022-10-03 01:09:48 +08:00
|
|
|
@icon($role->id === 0 ? 'groups' : 'role')
|
2022-10-02 20:17:28 +08:00
|
|
|
</div>
|
2022-10-03 01:09:48 +08:00
|
|
|
<span>
|
|
|
|
<strong>{{ $role->display_name }}</strong> <br>
|
|
|
|
<small class="text-muted">{{ $role->description }}</small>
|
|
|
|
</span>
|
|
|
|
@if($role->id !== 0)
|
|
|
|
<button type="button"
|
2023-01-29 00:06:11 +08:00
|
|
|
class="ml-auto flex-none text-small text-link text-button hover-underline item-list-row-toggle-all hide-under-s"
|
2022-10-02 20:57:32 +08:00
|
|
|
refs="permissions-table@toggle-all"
|
2022-10-03 01:09:48 +08:00
|
|
|
><strong>{{ trans('common.toggle_all') }}</strong></button>
|
|
|
|
@endif
|
2022-10-02 20:17:28 +08:00
|
|
|
</div>
|
2022-10-03 01:09:48 +08:00
|
|
|
@if($role->id === 0)
|
2022-10-11 00:22:38 +08:00
|
|
|
<div class="px-l flex-container-row items-center" refs="entity-permissions@everyone-inherit">
|
2022-10-03 01:09:48 +08:00
|
|
|
@include('form.custom-checkbox', [
|
|
|
|
'name' => 'entity-permissions-inherit',
|
2022-11-10 21:30:48 +08:00
|
|
|
'label' => trans('entities.permissions_inherit_defaults'),
|
2022-10-03 01:09:48 +08:00
|
|
|
'value' => 'true',
|
|
|
|
'checked' => $inheriting
|
|
|
|
])
|
|
|
|
</div>
|
|
|
|
@endif
|
2022-10-02 20:17:28 +08:00
|
|
|
<div class="flex-container-row justify-space-between gap-x-xl wrap items-center">
|
2022-10-11 00:22:38 +08:00
|
|
|
<input type="hidden" name="permissions[{{ $role->id }}][active]"
|
|
|
|
@if($inheriting) disabled="disabled" @endif
|
|
|
|
value="true">
|
2022-10-02 20:17:28 +08:00
|
|
|
<div class="px-l">
|
2022-10-10 19:24:23 +08:00
|
|
|
@include('form.custom-checkbox', [
|
|
|
|
'name' => 'permissions[' . $role->id . '][view]',
|
|
|
|
'label' => trans('common.view'),
|
|
|
|
'value' => 'true',
|
|
|
|
'checked' => $permission->view,
|
|
|
|
'disabled' => $inheriting
|
|
|
|
])
|
2022-10-02 20:17:28 +08:00
|
|
|
</div>
|
2023-06-26 06:22:49 +08:00
|
|
|
@if($entityType !== 'page' && $entityType !== 'bookshelf')
|
2022-10-10 19:24:23 +08:00
|
|
|
<div class="px-l">
|
|
|
|
@include('form.custom-checkbox', [
|
|
|
|
'name' => 'permissions[' . $role->id . '][create]',
|
|
|
|
'label' => trans('common.create'),
|
|
|
|
'value' => 'true',
|
|
|
|
'checked' => $permission->create,
|
|
|
|
'disabled' => $inheriting
|
|
|
|
])
|
|
|
|
</div>
|
|
|
|
@endif
|
2022-10-02 20:17:28 +08:00
|
|
|
<div class="px-l">
|
2022-10-10 19:24:23 +08:00
|
|
|
@include('form.custom-checkbox', [
|
|
|
|
'name' => 'permissions[' . $role->id . '][update]',
|
|
|
|
'label' => trans('common.update'),
|
|
|
|
'value' => 'true',
|
|
|
|
'checked' => $permission->update,
|
|
|
|
'disabled' => $inheriting
|
|
|
|
])
|
2022-10-02 20:17:28 +08:00
|
|
|
</div>
|
|
|
|
<div class="px-l">
|
2022-10-10 19:24:23 +08:00
|
|
|
@include('form.custom-checkbox', [
|
|
|
|
'name' => 'permissions[' . $role->id . '][delete]',
|
|
|
|
'label' => trans('common.delete'),
|
|
|
|
'value' => 'true',
|
|
|
|
'checked' => $permission->delete,
|
|
|
|
'disabled' => $inheriting
|
|
|
|
])
|
2022-10-02 20:17:28 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
2022-10-10 19:24:23 +08:00
|
|
|
@if($role->id !== 0)
|
|
|
|
<div class="flex-container-row items-center px-m py-s">
|
|
|
|
<button type="button"
|
|
|
|
class="text-neg p-m icon-button"
|
|
|
|
data-role-id="{{ $role->id }}"
|
|
|
|
data-role-name="{{ $role->display_name }}"
|
2022-10-11 22:52:56 +08:00
|
|
|
title="{{ trans('common.remove') }}">
|
|
|
|
@icon('close') <span class="hide-over-m ml-xs">{{ trans('common.remove') }}</span>
|
2022-10-10 19:24:23 +08:00
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
@endif
|
2022-10-02 20:17:28 +08:00
|
|
|
</div>
|