mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-02 01:52:10 +09:00
#124. 페이지 모듈에 열람/관리 권한 추가 및 이를 위해서 zbxe module 설정에 permission 속성 추가
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@2601 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
dc24001d46
commit
ce4afeaa13
16 changed files with 229 additions and 24 deletions
|
|
@ -92,15 +92,7 @@
|
|||
$grant->is_admin = false;
|
||||
}
|
||||
|
||||
// act값에 admin이 들어 있는데 관리자가 아닌 경우 오류 표시
|
||||
if(substr_count($this->act, 'Admin')) {
|
||||
if(!$is_logged) {
|
||||
$this->setAct("dispMemberLoginForm");
|
||||
} elseif(!$grant->is_admin) {
|
||||
return $this->stop('msg_not_permitted_act');
|
||||
}
|
||||
}
|
||||
|
||||
// module.xml 에 있는 권한 정보를 정리
|
||||
if($module_info->grants) {
|
||||
foreach($module_info->grants as $key => $val) {
|
||||
if(!$xml_info->grant->{$key}) {
|
||||
|
|
@ -160,6 +152,26 @@
|
|||
}
|
||||
}
|
||||
|
||||
// act값에 admin이 들어 있는데 관리자가 아닌 경우 오류 표시
|
||||
if(substr_count($this->act, 'Admin')) {
|
||||
// 로그인 되어 있지 않다면 무조건 금지
|
||||
if(!$is_logged) $this->setAct("dispMemberLoginForm");
|
||||
else {
|
||||
|
||||
$permitted = false;
|
||||
|
||||
// 최고관리자이면 무조건 패스~
|
||||
if($grant->is_admin) $permitted = true;
|
||||
|
||||
// 최고관리자가 아니더라도 module.xml에서 permission에 등록된 권한이 있으면 허용
|
||||
$permission_target = $xml_info->permission->{$this->act};
|
||||
if($permission_target && $grant->{$permission_target}) $permitted = true;
|
||||
|
||||
if(!$permitted) return $this->stop('msg_not_permitted_act');
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// 권한변수 설정
|
||||
$this->grant = $grant;
|
||||
Context::set('grant', $grant);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue