public function editPermissions(PermissionHandler $permissionHandler) { /** @var SettingsHandler $settingsHandler */ $settingsHandler = app('xe.settings'); $permissionGroups = $settingsHandler->getPermissionList(); foreach ($permissionGroups as $tab => &$group) { foreach ($group as $key => &$item) { $permission = $permissionHandler->get('settings.' . $item['id']); if ($permission === null) { $permission = $permissionHandler->register('settings.' . $item['id'], new Grant()); } $item['id'] = 'settings.' . $item['id']; $item['permission'] = $permission; } } return \XePresenter::make('settings.permissions', compact('permissionGroups')); }
/** * Get a permission * * @param string $name permission name * @param string $siteKey site key name * @return Permission|null */ protected function get($name, $siteKey = 'default') { return $this->perm->get($name, $siteKey); }
/** * 게시판 기본 권한 반환 * * @return \Xpressengine\Permission\Permission */ public function getGlobal() { $permission = $this->permissionHandler->get($this->prefix); return $permission; }