mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-09 23:24:06 -08:00
Ensure users are scoped by company in index method
This commit is contained in:
parent
aafa1ab70e
commit
806ab2cb9d
|
@ -75,7 +75,6 @@ class UsersController extends Controller
|
|||
|
||||
])->with('manager', 'groups', 'userloc', 'company', 'department', 'assets', 'licenses', 'accessories', 'consumables', 'createdBy',)
|
||||
->withCount('assets as assets_count', 'licenses as licenses_count', 'accessories as accessories_count', 'consumables as consumables_count');
|
||||
$users = Company::scopeCompanyables($users);
|
||||
|
||||
|
||||
if ($request->filled('activated')) {
|
||||
|
@ -271,6 +270,8 @@ class UsersController extends Controller
|
|||
} elseif (($request->filled('all')) && ($request->input('all') == 'true')) {
|
||||
$users = $users->withTrashed();
|
||||
}
|
||||
|
||||
$users = Company::scopeCompanyables($users);
|
||||
|
||||
$total = $users->count();
|
||||
$users = $users->skip($offset)->take($limit)->get();
|
||||
|
|
Loading…
Reference in a new issue