Register the accessories.files ability and allow users with the ability to upload files for accessories

This commit is contained in:
Marcus Moore 2023-01-17 16:59:50 -08:00
parent 1fef992fa8
commit 6c89f08193
No known key found for this signature in database
2 changed files with 7 additions and 2 deletions

View file

@ -114,6 +114,12 @@ class AuthServiceProvider extends ServiceProvider
} }
}); });
Gate::define('accessories.files', function ($user) {
if ($user->hasAccess('accessories.files')) {
return true;
}
});
Gate::define('components.files', function ($user) { Gate::define('components.files', function ($user) {
if ($user->hasAccess('components.files')) { if ($user->hasAccess('components.files')) {
return true; return true;

View file

@ -84,8 +84,7 @@
</li> </li>
@endcan @endcan
@can('update', Component::class) @can('update', \App\Models\Accessory::class)
<li class="pull-right"> <li class="pull-right">
<a href="#" data-toggle="modal" data-target="#uploadFileModal"> <a href="#" data-toggle="modal" data-target="#uploadFileModal">
<i class="fas fa-paperclip" aria-hidden="true"></i> {{ trans('button.upload') }} <i class="fas fa-paperclip" aria-hidden="true"></i> {{ trans('button.upload') }}