Gates the dropdown based on user permissions

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe 2024-09-25 20:29:23 +01:00
parent f6d7ea19e4
commit 2218c94aa3

View file

@ -1,3 +1,4 @@
@can('view', \App\Models\User::class)
<div id="userBulkEditToolbar"> <div id="userBulkEditToolbar">
{{ Form::open([ {{ Form::open([
'method' => 'POST', 'method' => 'POST',
@ -10,9 +11,16 @@
<div id="users-toolbar"> <div id="users-toolbar">
<label for="bulk_actions" class="sr-only">{{ trans('general.bulk_actions') }}</label> <label for="bulk_actions" class="sr-only">{{ trans('general.bulk_actions') }}</label>
<select name="bulk_actions" class="form-control select2" style="min-width:300px;" aria-label="bulk_actions"> <select name="bulk_actions" class="form-control select2" style="min-width:300px;" aria-label="bulk_actions">
@can('update', \App\Models\User::class)
<option value="edit">{{ trans('general.bulk_edit') }}</option> <option value="edit">{{ trans('general.bulk_edit') }}</option>
<option value="delete">{!! trans('general.bulk_checkin_delete') !!}</option>
<option value="merge">{!! trans('general.merge_users') !!}</option> <option value="merge">{!! trans('general.merge_users') !!}</option>
@endcan
@can('delete', \App\Models\User::class)
<option value="delete">{!! trans('general.bulk_checkin_delete') !!}</option>
@endcan
<option value="bulkpasswordreset">{{ trans('button.send_password_link') }}</option> <option value="bulkpasswordreset">{{ trans('button.send_password_link') }}</option>
<option value="print">{{ trans('admin/users/general.print_assigned') }}</option> <option value="print">{{ trans('admin/users/general.print_assigned') }}</option>
</select> </select>
@ -22,3 +30,4 @@
@endif @endif
{{ Form::close() }} {{ Form::close() }}
</div> </div>
@endcan