mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-25 05:34:06 -08:00
* Add permission to view and modify files for licenses * Actually use the permission
This commit is contained in:
parent
6a8d5282ef
commit
157d9e4ebb
|
@ -35,4 +35,14 @@ class LicensePolicy extends CheckoutablePermissionsPolicy
|
|||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether the user can access files associated with licenses.
|
||||
*
|
||||
* @param \App\Models\User $user
|
||||
* @return mixed
|
||||
*/
|
||||
public function files(User $user)
|
||||
{
|
||||
return $user->hasAccess($this->columnName().'.files');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -218,6 +218,12 @@ return array(
|
|||
'note' => '',
|
||||
'display' => true,
|
||||
),
|
||||
array(
|
||||
'permission' => 'licenses.files',
|
||||
'label' => 'View and Modify License Files',
|
||||
'note' => '',
|
||||
'display' => true,
|
||||
),
|
||||
),
|
||||
|
||||
|
||||
|
|
|
@ -31,7 +31,9 @@
|
|||
<ul class="nav nav-tabs">
|
||||
<li class="active"><a href="#details" data-toggle="tab">Details</a></li>
|
||||
<li><a href="#seats" data-toggle="tab">{{ trans('admin/licenses/form.seats') }}</a></li>
|
||||
@can('files', $license)
|
||||
<li><a href="#uploads" data-toggle="tab">{{ trans('general.file_uploads') }}</a></li>
|
||||
@endcan
|
||||
<li><a href="#history" data-toggle="tab">{{ trans('admin/licenses/general.checkout_history') }}</a></li>
|
||||
<li class="pull-right"><a href="#" data-toggle="modal" data-target="#uploadFileModal"><i class="fa fa-paperclip" aria-hidden="true"></i> {{ trans('button.upload') }}</a></li>
|
||||
</ul>
|
||||
|
@ -364,6 +366,7 @@
|
|||
</div> <!--/.row-->
|
||||
</div> <!-- /.tab-pane -->
|
||||
|
||||
@can('files', $license)
|
||||
<div class="tab-pane" id="uploads">
|
||||
<div class="table-responsive">
|
||||
<table
|
||||
|
@ -447,6 +450,7 @@
|
|||
</table>
|
||||
</div>
|
||||
</div> <!-- /.tab-pane -->
|
||||
@endcan
|
||||
|
||||
<div class="tab-pane" id="history">
|
||||
<div class="row">
|
||||
|
|
Loading…
Reference in a new issue