bt-trader init

This commit is contained in:
최준흠 2026-03-04 11:31:34 +09:00
parent 5b7bdfc424
commit 490b443e82

View File

@ -53,11 +53,15 @@ class AuthContext
return $this->getAuthInfo('name'); return $this->getAuthInfo('name');
} }
public function getRole(): array|null public function getRole(): string|null
{ {
return $this->getAuthInfo('role'); return $this->getAuthInfo('role');
} }
public function getRoles(): array|null
{
return explode(DEFAULTS['DELIMITER_COMMA'], $this->getRole());
}
public function isLoggedIn(): bool public function isLoggedIn(): bool
{ {
return $this->session->has(self::SESSION_IS_LOGIN); return $this->session->has(self::SESSION_IS_LOGIN);
@ -65,7 +69,7 @@ class AuthContext
public function isAccessRole(array $roles): bool public function isAccessRole(array $roles): bool
{ {
$userRoles = $this->getRole(); $userRoles = $this->getRoles();
if (empty($userRoles) || !is_array($userRoles)) { if (empty($userRoles) || !is_array($userRoles)) {
return false; return false;
} }