daemon-idc init

This commit is contained in:
최준흠 2026-03-02 13:39:00 +09:00
parent 982b78ec76
commit 4ca8f06e86
4 changed files with 17 additions and 9 deletions

View File

@ -7,20 +7,20 @@ use CodeIgniter\Router\RouteCollection;
*/ */
// $routes->get('/', 'Home::index'); // $routes->get('/', 'Home::index');
//choi.jh //choi.jh
//추가 Custom RULE 만들때 : ex)UUID형식 //추가 Custom RULE 만들때 : ex)UUID형식
$routes->addPlaceholder('uuid', '[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}'); $routes->addPlaceholder('uuid', '[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}');
//authFilter는 추가적인 작업이 필요 //authFilter는 추가적인 작업이 필요
//1. app/Filters/AuthFilter.php //1. app/Filters/AuthFilter.php
//2. Config/Filters.php -> $aliases = ['authFilter' => AuthFilter::class] //2. Config/Filters.php -> $aliases = ['authFilter' => AuthFilter::class]
$routes->group('cli', ['namespace' => 'App\Controllers\CLI'], function ($routes) {
});
$routes->group('', ['namespace' => 'App\Controllers\Front'], function ($routes) { $routes->group('', ['namespace' => 'App\Controllers\Front'], function ($routes) {
$routes->get('/', 'WelcomeController::index'); $routes->get('/', 'WelcomeController::index');
}); });
$routes->group('cli', ['namespace' => 'App\Controllers\CLI'], function ($routes) {
});
$routes->group('auth', ['namespace' => 'App\Controllers\Auth'], function ($routes) { $routes->group('auth', ['namespace' => 'App\Controllers\Auth'], function ($routes) {
$routes->get('login', 'LocalController::login_form'); $routes->get('login', 'LocalController::login_form');
$routes->post('login', 'LocalController::login'); $routes->post('login', 'LocalController::login');

View File

@ -32,6 +32,10 @@ class UserEntity extends CommonEntity
{ {
return $this->role; return $this->role;
} }
public function getRoles(): array
{
return explode(DEFAULTS['DELIMITER_COMMA'], $this->getRole());
}
public function getEmail(): string public function getEmail(): string
{ {
return $this->email; return $this->email;

View File

@ -95,7 +95,7 @@ class BoardForm extends CommonForm
case 'worker_uid': case 'worker_uid':
foreach ($this->getFormOption_process(service('userservice'), $field, $formDatas) as $tempEntity) { foreach ($this->getFormOption_process(service('userservice'), $field, $formDatas) as $tempEntity) {
$tempOptions[$tempEntity->getPK()] = $tempEntity->getTitle(); $tempOptions[$tempEntity->getPK()] = $tempEntity->getTitle();
// $options['attributes'][$tempEntity->getPK()] = ['data-role' => implode(DEFAULTS['DELIMITER_COMMA'], $tempEntity->getRole())]; // $options['attributes'][$tempEntity->getPK()] = ['data-role' => $tempEntity->getRole()];
} }
$options['options'] = $tempOptions; $options['options'] = $tempOptions;
break; break;

View File

@ -38,26 +38,30 @@ class AuthContext
// Public Accessors (AuthService에서 이동) // Public Accessors (AuthService에서 이동)
// ---------------------------------------------------- // ----------------------------------------------------
public function getUID(): int|null public function getUID(): int
{ {
return $this->getAuthInfo('uid'); return $this->getAuthInfo('uid');
} }
public function getID(): string|null public function getID(): string
{ {
return $this->getAuthInfo('id'); return $this->getAuthInfo('id');
} }
public function getName(): string|null public function getName(): string
{ {
return $this->getAuthInfo('name'); return $this->getAuthInfo('name');
} }
public function getRole(): array|null public function getRole(): string
{ {
return $this->getAuthInfo('role'); return $this->getAuthInfo('role');
} }
public function getRoles(): array
{
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;
} }