From 23a9977c930cfe40f6604e5fc900e99a749b184f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=B5=9C=EC=A4=80=ED=9D=A0git=20config=20git=20config=20-?= =?UTF-8?q?-helpgit=20config=20--global=20user=2Ename=20=EC=B5=9C=EC=A4=80?= =?UTF-8?q?=ED=9D=A0?= Date: Sat, 5 Aug 2023 13:10:52 +0900 Subject: [PATCH] servermgrv2 init... --- app/Controllers/Front/BoardController.php | 17 ++--------------- app/Controllers/Front/FrontController.php | 4 ++-- 2 files changed, 4 insertions(+), 17 deletions(-) diff --git a/app/Controllers/Front/BoardController.php b/app/Controllers/Front/BoardController.php index ee13e8e..eb77ac1 100644 --- a/app/Controllers/Front/BoardController.php +++ b/app/Controllers/Front/BoardController.php @@ -66,13 +66,6 @@ class BoardController extends FrontController $this->isRole('insert'); return parent::insert_form_process(); } - protected function insert_process() - { - //권한체크 - $this->isRole('insert'); - return parent::insert_process(); - } - //Update관련 protected function update_form_process($entity) { @@ -94,15 +87,9 @@ class BoardController extends FrontController protected function reply_form_process($entity) { //권한체크 - $this->isRole('reply'); + $this->isRole('reply', $entity); return parent::reply_form_process($entity); } - protected function reply_process($entity) - { - //권한체크 - $this->isRole('reply'); - return parent::reply_process($entity); - } //Delete 관련 protected function delete_process($entity) { @@ -116,7 +103,7 @@ class BoardController extends FrontController protected function view_process($entity) { //권한체크 - $this->isRole('view'); + $this->isRole('view', $entity); //조회수 올리기 $this->_model->addViewCount($entity); return parent::view_process($entity); diff --git a/app/Controllers/Front/FrontController.php b/app/Controllers/Front/FrontController.php index da3639d..5be3f71 100644 --- a/app/Controllers/Front/FrontController.php +++ b/app/Controllers/Front/FrontController.php @@ -25,9 +25,9 @@ abstract class FrontController extends BaseController } //권한체크 - final protected function isRole($action) + final protected function isRole($action, $entity = null) { - $this->_category = $this->request->getVar('category') ?: throw new \Exception("범주를 지정하지 않으셨습니다."); + $this->_category = !is_null($entity) ? $entity->getCategory_Uid() : ($this->request->getVar('category') ?: throw new \Exception("범주를 지정하지 않으셨습니다.")); $this->_viewDatas['category'] = $this->getCategoryModel()->getEntity([$this->getCategoryModel()->getPrimaryKey() => $this->_category]); switch ($action) { case 'insert':