Fixed #6349 - add view permission for print all assigned

This commit is contained in:
snipe 2018-10-19 16:46:46 -07:00
parent 2ded2ff53a
commit 20b26effdb
2 changed files with 8 additions and 1 deletions

View file

@ -613,6 +613,7 @@ class UsersController extends Controller
*/
public function printInventory($id)
{
$this->authorize('view', User::class);
$show_user = User::where('id', $id)->withTrashed()->first();
$assets = Asset::where('assigned_to', $id)->where('assigned_type', User::class)->with('model', 'model.category')->get();
$accessories = $show_user->accessories()->get();

View file

@ -233,12 +233,19 @@
<div class="col-md-12">
<a href="{{ route('users.edit', $user->id) }}" style="width: 100%;" class="btn btn-sm btn-default hidden-print">{{ trans('admin/users/general.edit') }}</a>
</div>
@endcan
@can('create', $user)
<div class="col-md-12" style="padding-top: 5px;">
<a href="{{ route('clone/user', $user->id) }}" style="width: 100%;" class="btn btn-sm btn-default hidden-print">{{ trans('admin/users/general.clone') }}</a>
</div>
@endcan
@can('view', $user)
<div class="col-md-12" style="padding-top: 5px;">
<a href="{{ route('users.print', $user->id) }}" style="width: 100%;" class="btn btn-sm btn-default hidden-print">{{ trans('admin/users/general.print_assigned') }}</a>
</div>
@endcan
@can('delete', $user)
@if ($user->deleted_at=='')
@ -263,7 +270,6 @@
</div>
@endif
@endcan
@endcan
</div>
<!-- End button column -->
</div> <!--/.row-->