mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-25 13:44:06 -08:00
Restrict to update or create gate methods for select lists
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
9226c8292d
commit
c1a0653847
|
@ -179,12 +179,18 @@ class AuthServiceProvider extends ServiceProvider
|
||||||
// to the logged in API user, but creating assets, licenses, etc won't work
|
// to the logged in API user, but creating assets, licenses, etc won't work
|
||||||
// if the user can't view and interact with the select lists.
|
// if the user can't view and interact with the select lists.
|
||||||
Gate::define('view.selectlists', function ($user) {
|
Gate::define('view.selectlists', function ($user) {
|
||||||
return $user->can('view', Asset::class)
|
return $user->can('update', Asset::class)
|
||||||
|| $user->can('view', License::class)
|
|| $user->can('create', License::class)
|
||||||
|| $user->can('view', Component::class)
|
|| $user->can('update', License::class)
|
||||||
|| $user->can('view', Consumable::class)
|
|| $user->can('create', License::class)
|
||||||
|| $user->can('view', Accessory::class)
|
|| $user->can('update', Component::class)
|
||||||
|| $user->can('view', User::class);
|
|| $user->can('create', Component::class)
|
||||||
|
|| $user->can('update', Consumable::class)
|
||||||
|
|| $user->can('create', Consumable::class)
|
||||||
|
|| $user->can('update', Accessory::class)
|
||||||
|
|| $user->can('create', Accessory::class)
|
||||||
|
|| $user->can('update', User::class)
|
||||||
|
|| $user->can('create', User::class);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue