diff --git a/app/Config/Constants.php b/app/Config/Constants.php index ca015b5..27c4ff5 100644 --- a/app/Config/Constants.php +++ b/app/Config/Constants.php @@ -166,15 +166,6 @@ define('SESSION_NAMES', [ 'CART' => 'cart' ]); define('AUTH_FIELDS', ['ID' => 'id', 'TITLE' => 'title', 'ROLE' => 'role']); -//Category관련 Role Fields -define('CATEGORY_ROLE_FIELDS', [ - 'ACCESS' => 'isaccess', - 'READ' => 'isread', - 'WRITE' => 'iswrite', - 'REPLY' => 'isreply', - 'UPLOAD' => 'isupload', - 'DONWLOAD' => 'isdownload', -]); //인증 관련 define('AUTH_ADAPTERS', [ diff --git a/app/Controllers/Front/FrontController.php b/app/Controllers/Front/FrontController.php index 30af901..942beb5 100644 --- a/app/Controllers/Front/FrontController.php +++ b/app/Controllers/Front/FrontController.php @@ -33,22 +33,22 @@ abstract class FrontController extends BaseController $this->_viewDatas['parent_category'] = $this->getCategoryModel()->getEntity([$this->getCategoryModel()->getPrimaryKey() => $this->_viewDatas['category']->getHierarchy_ParentUID()]); switch ($action) { case 'insert': - $category_field = CATEGORY_ROLE_FIELDS['WRITE']; + $category_field = getenv("category.role.{$action}") ?: 'iswrite'; break; case 'reply': - $category_field = CATEGORY_ROLE_FIELDS['REPLY']; + $category_field = getenv("category.role.{$action}") ?: 'isreply'; break; case 'view': - $category_field = CATEGORY_ROLE_FIELDS['READ']; + $category_field = getenv("category.role.{$action}") ?: 'isread'; break; case 'upload': - $category_field = CATEGORY_ROLE_FIELDS['UPLOAD']; + $category_field = getenv("category.role.{$action}") ?: 'isupload'; break; case 'download': - $category_field = CATEGORY_ROLE_FIELDS['DONWLOAD']; + $category_field = getenv("category.role.{$action}") ?: 'isdownload'; break; default: - $category_field = CATEGORY_ROLE_FIELDS['ACCESS']; + $category_field = getenv("category.role.{$action}") ?: 'isdaccess'; break; } //사용자가 Category에서 해당 게시판의 해당권한이 있는지 확인