Merge pull request #11254 from snipe/fixes/11224_only_show_possible_options_in_bulk_menu

Fixed  #11224 - only show menu options if the user is allowed
This commit is contained in:
snipe 2022-06-05 22:44:26 -07:00 committed by GitHub
commit 3bcd5d94d6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -12,11 +12,15 @@
</span>
</label>
<select name="bulk_actions" class="form-control select2" aria-label="bulk_actions">
<option value="edit">{{ trans('button.edit') }}</option>
<option value="delete">{{ trans('button.delete') }}</option>
@can('update', \App\Models\Asset::class)
<option value="edit">{{ trans('button.edit') }}</option>
@endcan
@can('delete', \App\Models\Asset::class)
<option value="delete">{{ trans('button.delete') }}</option>
@endcan
<option value="labels">{{ trans_choice('button.generate_labels', 2) }}</option>
</select>
<button class="btn btn-primary" id="bulkEdit" disabled>{{ trans('button.go') }}</button>
{{ Form::close() }}
</div>
</div>