Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

관리자페이지 권한설정을 무시하는 문제 #116

Open
darron1217 opened this issue Feb 18, 2020 · 0 comments
Open

관리자페이지 권한설정을 무시하는 문제 #116

darron1217 opened this issue Feb 18, 2020 · 0 comments

Comments

@darron1217
Copy link
Collaborator

public static function interceptGetSettingsMenus()
{
intercept(
SettingsHandler::class . '@getSettingsMenus',
'homespace_SettingsHandler::getSettingsMenus',
function ($func, $isSuper) {
$menus = $func($isSuper);
/** @var UserInterface $user */
$user = Auth::user();
/**
* 관리자 메뉴 정리
*
* 최고 관리자가 아닌 경우 몇개만 보여줌
*/
$isSystemAdmin = false;
if ($user->rating === Rating::SUPER) {
$isSystemAdmin = true;
}
// 시스템 관리자가 아니면
if ($isSystemAdmin == false) {
$menus->forget(['dashboard', 'sitemap', 'user', 'contents', 'plugin', 'setting', 'lang', 'xeropay']);
$xero_commerce = $menus->get('xero_commerce')->getChildren();
$xero_commerce->forget(['xero_commerce.config']);
$xero_commerce_product = $xero_commerce->get('xero_commerce.product')->getChildren();
$xero_commerce_product->forget(['xero_commerce.product.label', 'xero_commerce.product.badge', 'xero_commerce.product.category']);
}
return $menus;
}
);
}

위 코드를 보면 시스템 최고관리자가 아니면 페이지들을 가려버리는 설정이 있더라구요.
XE3 자체에 관리자페이지 권한설정을 유동적으로 할 수 있는 로직을 다 무시하게되어서 제거되거나 조정이 필요할것 같습니다

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant