mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-11 13:57:41 -08:00
check if user is allowed to view assets (#4845)
This commit is contained in:
parent
f4e9d245d0
commit
0fb8dc3418
|
@ -286,6 +286,7 @@ class UsersController extends Controller
|
||||||
{
|
{
|
||||||
$this->authorize('view', User::class);
|
$this->authorize('view', User::class);
|
||||||
$assets = Asset::where('assigned_to', '=', $id)->with('model')->get();
|
$assets = Asset::where('assigned_to', '=', $id)->with('model')->get();
|
||||||
|
if ($assets) $this->authorize('view', $assets[0]);
|
||||||
return (new AssetsTransformer)->transformAssets($assets, $assets->count());
|
return (new AssetsTransformer)->transformAssets($assets, $assets->count());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue