2022-10-10 12:22:38 -04:00
|
|
|
<?php
|
2023-05-17 12:56:55 -04:00
|
|
|
/** @var \BookStack\Permissions\PermissionFormData $data */
|
2022-10-10 12:22:38 -04:00
|
|
|
?>
|
2022-10-10 07:24:23 -04:00
|
|
|
<form component="entity-permissions"
|
|
|
|
option:entity-permissions:entity-type="{{ $model->getType() }}"
|
|
|
|
action="{{ $model->getUrl('/permissions') }}"
|
|
|
|
method="POST">
|
2016-02-28 05:49:41 -05:00
|
|
|
{!! csrf_field() !!}
|
|
|
|
<input type="hidden" name="_method" value="PUT">
|
|
|
|
|
2022-10-11 10:41:21 -04:00
|
|
|
<div class="grid half left-focus v-end gap-m wrap">
|
2020-12-31 12:25:20 -05:00
|
|
|
<div>
|
2022-10-11 10:41:21 -04:00
|
|
|
<h1 class="list-heading">{{ $title }}</h1>
|
|
|
|
<p class="text-muted mb-s">
|
2022-10-11 10:52:56 -04:00
|
|
|
{{ trans('entities.permissions_desc') }}
|
2022-10-11 10:41:21 -04:00
|
|
|
|
|
|
|
@if($model instanceof \BookStack\Entities\Models\Book)
|
2022-10-11 10:52:56 -04:00
|
|
|
<br> {{ trans('entities.permissions_book_cascade') }}
|
|
|
|
@elseif($model instanceof \BookStack\Entities\Models\Chapter)
|
|
|
|
<br> {{ trans('entities.permissions_chapter_cascade') }}
|
2022-10-11 10:41:21 -04:00
|
|
|
@endif
|
|
|
|
</p>
|
|
|
|
|
|
|
|
@if($model instanceof \BookStack\Entities\Models\Bookshelf)
|
|
|
|
<p class="text-warn">{{ trans('entities.shelves_permissions_cascade_warning') }}</p>
|
|
|
|
@endif
|
2020-12-31 10:27:25 -05:00
|
|
|
</div>
|
2022-10-11 10:41:21 -04:00
|
|
|
<div class="flex-container-row justify-flex-end">
|
|
|
|
<div class="form-group mb-m">
|
2020-12-31 12:25:20 -05:00
|
|
|
<label for="owner">{{ trans('entities.permissions_owner') }}</label>
|
2022-05-14 11:05:29 -04:00
|
|
|
@include('form.user-select', ['user' => $model->ownedBy, 'name' => 'owned_by'])
|
2020-12-31 12:25:20 -05:00
|
|
|
</div>
|
2020-12-31 10:27:25 -05:00
|
|
|
</div>
|
2016-02-28 05:49:41 -05:00
|
|
|
</div>
|
|
|
|
|
2022-10-11 10:41:21 -04:00
|
|
|
<hr>
|
2021-08-28 10:44:44 -04:00
|
|
|
|
2022-10-29 10:23:21 -04:00
|
|
|
<div refs="entity-permissions@role-container" class="item-list mt-m mb-m">
|
2022-10-10 07:24:23 -04:00
|
|
|
@foreach($data->permissionsWithRoles() as $permission)
|
|
|
|
@include('form.entity-permissions-row', [
|
|
|
|
'permission' => $permission,
|
|
|
|
'role' => $permission->role,
|
2022-10-10 12:22:38 -04:00
|
|
|
'entityType' => $model->getType(),
|
|
|
|
'inheriting' => false,
|
2022-10-10 07:24:23 -04:00
|
|
|
])
|
2016-02-28 05:49:41 -05:00
|
|
|
@endforeach
|
2022-10-02 08:17:28 -04:00
|
|
|
</div>
|
2016-02-28 05:49:41 -05:00
|
|
|
|
2022-10-10 07:24:23 -04:00
|
|
|
<div class="flex-container-row justify-flex-end mb-xl">
|
2022-10-11 10:41:21 -04:00
|
|
|
<div class="flex-container-row items-center gap-m">
|
2023-05-17 12:56:55 -04:00
|
|
|
<label for="role_select" class="m-none p-none"><span
|
|
|
|
class="bold">{{ trans('entities.permissions_role_override') }}</span></label>
|
2022-10-10 07:24:23 -04:00
|
|
|
<select name="role_select" id="role_select" refs="entity-permissions@role-select">
|
|
|
|
<option value="">{{ trans('common.select') }}</option>
|
|
|
|
@foreach($data->rolesNotAssigned() as $role)
|
|
|
|
<option value="{{ $role->id }}">{{ $role->display_name }}</option>
|
|
|
|
@endforeach
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2022-10-29 10:23:21 -04:00
|
|
|
<div class="item-list mt-m mb-xl">
|
2022-10-10 07:24:23 -04:00
|
|
|
@include('form.entity-permissions-row', [
|
|
|
|
'role' => $data->everyoneElseRole(),
|
2022-10-10 12:22:38 -04:00
|
|
|
'permission' => $data->everyoneElseEntityPermission(),
|
2022-10-10 07:24:23 -04:00
|
|
|
'entityType' => $model->getType(),
|
2022-10-10 12:22:38 -04:00
|
|
|
'inheriting' => !$model->permissions()->where('role_id', '=', 0)->exists(),
|
2022-10-10 07:24:23 -04:00
|
|
|
])
|
2022-10-02 13:09:48 -04:00
|
|
|
</div>
|
|
|
|
|
2022-10-11 10:41:21 -04:00
|
|
|
<hr class="mb-m">
|
|
|
|
|
2023-07-12 17:04:05 -04:00
|
|
|
<div class="flex-container-row justify-space-between gap-m wrap">
|
|
|
|
<div class="flex min-width-m">
|
|
|
|
@if($model instanceof \BookStack\Entities\Models\Bookshelf)
|
|
|
|
<p class="small text-muted mb-none">
|
|
|
|
* {{ trans('entities.shelves_permissions_create') }}
|
|
|
|
</p>
|
|
|
|
@endif
|
|
|
|
</div>
|
|
|
|
<div class="text-right">
|
|
|
|
<a href="{{ $model->getUrl() }}" class="button outline">{{ trans('common.cancel') }}</a>
|
|
|
|
<button type="submit" class="button">{{ trans('entities.permissions_save') }}</button>
|
|
|
|
</div>
|
2017-08-26 08:24:55 -04:00
|
|
|
</div>
|
2016-02-28 05:49:41 -05:00
|
|
|
</form>
|