mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-11 13:57:41 -08:00
Restrict users asset listing to just assets checked out to users
This commit is contained in:
parent
708b1a962c
commit
614e858e44
|
@ -292,7 +292,7 @@ class UsersController extends Controller
|
||||||
{
|
{
|
||||||
$this->authorize('view', User::class);
|
$this->authorize('view', User::class);
|
||||||
$this->authorize('view', Asset::class);
|
$this->authorize('view', Asset::class);
|
||||||
$assets = Asset::where('assigned_to', '=', $id)->with('model')->get();
|
$assets = Asset::where('assigned_to', '=', $id)->where('assigned_type', '=', User::class)->with('model')->get();
|
||||||
return (new AssetsTransformer)->transformAssets($assets, $assets->count());
|
return (new AssetsTransformer)->transformAssets($assets, $assets->count());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue