mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-11 13:57:41 -08:00
Skip superuser check if the user isn't logged in
This commit is contained in:
parent
0fd43c0a5d
commit
c29984d0df
|
@ -129,7 +129,7 @@ final class Company extends Model
|
|||
|
||||
public static function scopeCompanyables($query, $column = 'company_id')
|
||||
{
|
||||
if (!static::isFullMultipleCompanySupportEnabled() || Auth::user()->isSuperUser()) {
|
||||
if (!static::isFullMultipleCompanySupportEnabled() || (Auth::check() && Auth::user()->isSuperUser())) {
|
||||
return $query;
|
||||
} else {
|
||||
return static::scopeCompanyablesDirectly($query, $column);
|
||||
|
|
Loading…
Reference in a new issue