servermgrv2 init...

This commit is contained in:
최준흠git config git config --helpgit config --global user.name 최준흠 2023-08-05 13:10:52 +09:00
parent fe170ead70
commit 23a9977c93
2 changed files with 4 additions and 17 deletions

View File

@ -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);

View File

@ -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':