fix unittests issues
API CI/CD / Validate (composer + pint) (push) Successful in 3m6s
API CI/CD / Test (PHPUnit) (push) Failing after 4m53s
API CI/CD / Build frontend assets (push) Successful in 1m2s
API CI/CD / Security audit (push) Failing after 59s
API CI/CD / Deploy to shared hosting (PHP) (push) Has been skipped
API CI/CD / Validate (composer + pint) (push) Successful in 3m6s
API CI/CD / Test (PHPUnit) (push) Failing after 4m53s
API CI/CD / Build frontend assets (push) Successful in 1m2s
API CI/CD / Security audit (push) Failing after 59s
API CI/CD / Deploy to shared hosting (PHP) (push) Has been skipped
This commit is contained in:
@@ -9,7 +9,7 @@ class PreferencesPolicy
|
||||
{
|
||||
public function viewAny(User $user): bool
|
||||
{
|
||||
return $this->isAdmin($user);
|
||||
return $this->isAdmin($user) || $user->roles()->count() > 1;
|
||||
}
|
||||
|
||||
public function view(User $user, Preferences $preferences): bool
|
||||
@@ -24,7 +24,7 @@ class PreferencesPolicy
|
||||
|
||||
public function delete(User $user, Preferences $preferences): bool
|
||||
{
|
||||
return $preferences->user_id === $user->id || $this->isAdmin($user);
|
||||
return $this->isAdmin($user) || ($preferences->user_id === $user->id && $user->roles()->count() > 1);
|
||||
}
|
||||
|
||||
public function create(User $user): bool
|
||||
|
||||
Reference in New Issue
Block a user