diff --git a/src/Authorization/Traits/Authorizable.php b/src/Authorization/Traits/Authorizable.php index d49628641..72fd527a3 100644 --- a/src/Authorization/Traits/Authorizable.php +++ b/src/Authorization/Traits/Authorizable.php @@ -287,7 +287,7 @@ public function can(string ...$permissions): bool $check = implode('.', array_slice($parts, 0, $i)) . '.*'; $checks[] = $check; } - if (isset($matrix[$group]) && array_intersect($checks, $matrix[$group])) { + if (isset($matrix[$group]) && array_intersect($checks, $matrix[$group]) !== []) { return true; } } diff --git a/src/Entities/Group.php b/src/Entities/Group.php index 93e06be79..5b417a6b2 100644 --- a/src/Entities/Group.php +++ b/src/Entities/Group.php @@ -95,7 +95,7 @@ public function can(string $permission): bool return $this->permissions !== null && $this->permissions !== [] - && ! empty(array_intersect($checks, $this->permissions)); + && array_intersect($checks, $this->permissions) !== []; } /**