mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-24 21:24:13 -08:00
Merge pull request #12370 from marcusmoore/fix/file-upload-tab-permissions
Fixed file uploads for accessories, components, and consumables
This commit is contained in:
commit
155977de2d
|
@ -114,6 +114,24 @@ class AuthServiceProvider extends ServiceProvider
|
|||
}
|
||||
});
|
||||
|
||||
Gate::define('accessories.files', function ($user) {
|
||||
if ($user->hasAccess('accessories.files')) {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
Gate::define('components.files', function ($user) {
|
||||
if ($user->hasAccess('components.files')) {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
Gate::define('consumables.files', function ($user) {
|
||||
if ($user->hasAccess('consumables.files')) {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
// Can the user import CSVs?
|
||||
Gate::define('import', function ($user) {
|
||||
if ($user->hasAccess('import')) {
|
||||
|
|
|
@ -84,8 +84,7 @@
|
|||
</li>
|
||||
@endcan
|
||||
|
||||
@can('update', Component::class)
|
||||
|
||||
@can('update', $accessory)
|
||||
<li class="pull-right">
|
||||
<a href="#" data-toggle="modal" data-target="#uploadFileModal">
|
||||
<i class="fas fa-paperclip" aria-hidden="true"></i> {{ trans('button.upload') }}
|
||||
|
@ -99,7 +98,7 @@
|
|||
<div class="tab-pane active" id="checkedout">
|
||||
<div class="table table-responsive">
|
||||
<div class="row">
|
||||
<div class="col-md-9">
|
||||
<div class="col-md-12">
|
||||
<table
|
||||
data-cookie-id-table="usersTable"
|
||||
data-pagination="true"
|
||||
|
@ -136,7 +135,7 @@
|
|||
<div class="tab-pane fade" id="history">
|
||||
<div class="table table-responsive">
|
||||
<div class="row">
|
||||
<div class="col-md-9">
|
||||
<div class="col-md-12">
|
||||
<table
|
||||
class="table table-striped snipe-table"
|
||||
data-cookie-id-table="AccessoryHistoryTable"
|
||||
|
@ -266,14 +265,14 @@
|
|||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> <!-- /.tab-pane -->
|
||||
@endcan
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- side address column -->
|
||||
|
@ -345,9 +344,6 @@
|
|||
</div>
|
||||
@endcan
|
||||
|
||||
</div><!--col-md-3-->
|
||||
</div><!--row-->
|
||||
</div><!--tab-pane details-->
|
||||
|
||||
<div class="tab-pane fade" id="history">
|
||||
<div class="row">
|
||||
|
@ -387,8 +383,8 @@
|
|||
</div> <!-- /.col-md-12-->
|
||||
</div> <!-- /.row-->
|
||||
</div><!--tab history-->
|
||||
</div><!--tab-content-->
|
||||
</div><!--/.nav-tabs-custom-->
|
||||
</div><!--col-md-3-->
|
||||
</div><!--row-->
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -80,8 +80,7 @@
|
|||
</li>
|
||||
@endcan
|
||||
|
||||
@can('update', Component::class)
|
||||
|
||||
@can('components.files', $component)
|
||||
<li class="pull-right">
|
||||
<a href="#" data-toggle="modal" data-target="#uploadFileModal">
|
||||
<i class="fas fa-paperclip" aria-hidden="true"></i> {{ trans('button.upload') }}
|
||||
|
|
|
@ -45,8 +45,7 @@
|
|||
</li>
|
||||
@endcan
|
||||
|
||||
@can('update', Consumable::class)
|
||||
|
||||
@can('update', $consumable)
|
||||
<li class="pull-right">
|
||||
<a href="#" data-toggle="modal" data-target="#uploadFileModal">
|
||||
<i class="fas fa-paperclip" aria-hidden="true"></i> {{ trans('button.upload') }}
|
||||
|
@ -200,7 +199,7 @@
|
|||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
|
||||
|
||||
@if ($consumable->image!='')
|
||||
<div class="col-md-12 text-center">
|
||||
<a href="{{ Storage::disk('public')->url('consumables/'.e($consumable->image)) }}" data-toggle="lightbox">
|
||||
|
@ -260,7 +259,7 @@
|
|||
{{ trans('general.checkout') }}
|
||||
</a>
|
||||
@else
|
||||
<button style="margin-bottom:10px; width:100%"" class="btn btn-primary btn-sm disabled">
|
||||
<button style="margin-bottom:10px; width:100%" class="btn btn-primary btn-sm disabled">
|
||||
{{ trans('general.checkout') }}
|
||||
</button>
|
||||
@endif
|
||||
|
@ -269,7 +268,7 @@
|
|||
@endcan
|
||||
|
||||
@if ($consumable->notes)
|
||||
|
||||
|
||||
<div class="col-md-12">
|
||||
<strong>
|
||||
{{ trans('general.notes') }}:
|
||||
|
@ -282,7 +281,7 @@
|
|||
@endif
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div> <!-- /.col-md-3-->
|
||||
</div> <!-- /.row-->
|
||||
|
||||
|
|
Loading…
Reference in a new issue