Skip to content

Commit

Permalink
MISC updates
Browse files Browse the repository at this point in the history
  • Loading branch information
asika32764 committed Jan 21, 2024
1 parent 1bc83cb commit a7ccae0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Middleware/AccessMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ function (OptionsResolver $resolver) {

public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
{
$allow = true;
$allow = false;
$userService = $this->app->service(UserService::class);

if ($this->rules instanceof Closure) {
Expand All @@ -84,7 +84,7 @@ public function process(ServerRequestInterface $request, RequestHandlerInterface
$rules = (array) $this->rules;

foreach ($rules as $rule) {
$allow = $allow && $userService->can($rule);
$allow = $allow || $userService->can($rule);
}

if (!$allow) {
Expand Down

0 comments on commit a7ccae0

Please sign in to comment.