From 490b443e829762fc2dc8ed9f6ab9e94e9338660a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=B5=9C=EC=A4=80=ED=9D=A0?= Date: Wed, 4 Mar 2026 11:31:34 +0900 Subject: [PATCH] bt-trader init --- app/Libraries/AuthContext.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/Libraries/AuthContext.php b/app/Libraries/AuthContext.php index 890900d..219a772 100644 --- a/app/Libraries/AuthContext.php +++ b/app/Libraries/AuthContext.php @@ -53,11 +53,15 @@ class AuthContext return $this->getAuthInfo('name'); } - public function getRole(): array|null + public function getRole(): string|null { return $this->getAuthInfo('role'); } + public function getRoles(): array|null + { + return explode(DEFAULTS['DELIMITER_COMMA'], $this->getRole()); + } public function isLoggedIn(): bool { return $this->session->has(self::SESSION_IS_LOGIN); @@ -65,7 +69,7 @@ class AuthContext public function isAccessRole(array $roles): bool { - $userRoles = $this->getRole(); + $userRoles = $this->getRoles(); if (empty($userRoles) || !is_array($userRoles)) { return false; }