diff --git a/src/Service/Authorization.php b/src/Service/Authorization.php index a298d4fa..a4e4dc21 100644 --- a/src/Service/Authorization.php +++ b/src/Service/Authorization.php @@ -76,6 +76,13 @@ public function isAllowed(string $right, $subject = null): bool $userId = $this->tokenService->getTokenClaim(Token::CLAIM_USERID); $groups = $this->legacyService->getUserGroupIds($userId); + +file_put_contents(__DIR__ . '/../../tests-authorization.txt', '-----------------' . PHP_EOL, FILE_APPEND | LOCK_EX); +file_put_contents(__DIR__ . '/../../tests-authorization.txt', ' userId: '. $userId . PHP_EOL, FILE_APPEND | LOCK_EX); +file_put_contents(__DIR__ . '/../../tests-authorization.txt', ' groups: '. serialize($groups) . PHP_EOL, FILE_APPEND | LOCK_EX); +file_put_contents(__DIR__ . '/../../tests-authorization.txt', ' permissions: '. serialize($this->permissions) . PHP_EOL, FILE_APPEND | LOCK_EX); + + $isAllowed = false; foreach ($groups as $id) { diff --git a/src/Service/Token.php b/src/Service/Token.php index 19c0c11e..f4a1d03d 100644 --- a/src/Service/Token.php +++ b/src/Service/Token.php @@ -127,6 +127,10 @@ public function createToken(?string $username = null, ?string $password = null): $config->signingKey() ); + file_put_contents(__DIR__ . '/../../tests-token.txt', '-----------------' . PHP_EOL, FILE_APPEND | LOCK_EX); + file_put_contents(__DIR__ . '/../../tests-token.txt', 'userId: ' . $user->id()->val() . PHP_EOL, FILE_APPEND | LOCK_EX); + file_put_contents(__DIR__ . '/../../tests-token.txt', 'token: ' . $token->toString() . PHP_EOL, FILE_APPEND | LOCK_EX); + $this->registerToken($user, $token, $time, $expire); return $token;