mirror of
https://github.com/espocrm/espocrm.git
synced 2026-06-28 23:16:03 +00:00
config superAdminSystemItems
This commit is contained in:
@@ -282,6 +282,11 @@ class Config
|
||||
return $this->get('systemItems', []);
|
||||
}
|
||||
|
||||
public function getSuperAdminOnlySystemItemList()
|
||||
{
|
||||
return $this->get('superAdminSystemItems', []);
|
||||
}
|
||||
|
||||
public function getUserOnlyItemList()
|
||||
{
|
||||
return $this->get('userItems', []);
|
||||
|
||||
@@ -82,6 +82,7 @@ return [
|
||||
'systemItems',
|
||||
'adminItems',
|
||||
'superAdminItems',
|
||||
'superAdminSystemItems',
|
||||
'configPath',
|
||||
'cachePath',
|
||||
'database',
|
||||
@@ -116,6 +117,7 @@ return [
|
||||
'requiredMariadbVersion',
|
||||
'recommendedMariadbParams',
|
||||
'phpExecutablePath',
|
||||
'webSocketDebugMode',
|
||||
],
|
||||
'adminItems' => [
|
||||
'devMode',
|
||||
@@ -206,6 +208,8 @@ return [
|
||||
'siteUrl',
|
||||
'useWebSocket',
|
||||
'webSocketUrl',
|
||||
],
|
||||
'superAdminSystemItems' => [
|
||||
'webSocketSslCertificateFile',
|
||||
'webSocketSslCertificateKeyFile',
|
||||
'webSocketSslAllowSelfSigned',
|
||||
|
||||
@@ -71,21 +71,24 @@ class Settings extends \Espo\Core\Services\Base
|
||||
|
||||
$ignoreItemList = [];
|
||||
|
||||
$systemOnlyItemList = $this->getSystemOnlyItemList();
|
||||
foreach ($systemOnlyItemList as $item) {
|
||||
foreach ($this->getSystemOnlyItemList() as $item) {
|
||||
$ignoreItemList[] = $item;
|
||||
}
|
||||
|
||||
if (!$this->getUser()->isAdmin() || $this->getUser()->isSystem()) {
|
||||
$adminOnlyItemList = $this->getAdminOnlyItemList();
|
||||
foreach ($adminOnlyItemList as $item) {
|
||||
foreach ($this->getAdminOnlyItemList() as $item) {
|
||||
$ignoreItemList[] = $item;
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->getUser()->isSystem()) {
|
||||
$userOnlyItemList = $this->getUserOnlyItemList();
|
||||
foreach ($userOnlyItemList as $item) {
|
||||
foreach ($this->getUserOnlyItemList() as $item) {
|
||||
$ignoreItemList[] = $item;
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->getConfig()->get('restrictedMode') && !$this->getUser()->isSuperAdmin()) {
|
||||
foreach ($this->getConfig()->getSuperAdminOnlySystemItemList() as $item) {
|
||||
$ignoreItemList[] = $item;
|
||||
}
|
||||
}
|
||||
@@ -120,14 +123,15 @@ class Settings extends \Espo\Core\Services\Base
|
||||
|
||||
$ignoreItemList = [];
|
||||
|
||||
$systemOnlyItemList = $this->getSystemOnlyItemList();
|
||||
foreach ($systemOnlyItemList as $item) {
|
||||
foreach ($this->getSystemOnlyItemList() as $item) {
|
||||
$ignoreItemList[] = $item;
|
||||
}
|
||||
|
||||
if ($this->getConfig()->get('restrictedMode') && !$this->getUser()->isSuperAdmin()) {
|
||||
$superAdminOnlyItemList = $this->getConfig()->getSuperAdminOnlyItemList();
|
||||
foreach ($superAdminOnlyItemList as $item) {
|
||||
foreach ($this->getConfig()->getSuperAdminOnlyItemList() as $item) {
|
||||
$ignoreItemList[] = $item;
|
||||
}
|
||||
foreach ($this->getConfig()->getSuperAdminOnlySystemItemList() as $item) {
|
||||
$ignoreItemList[] = $item;
|
||||
}
|
||||
}
|
||||
@@ -223,4 +227,5 @@ class Settings extends \Espo\Core\Services\Base
|
||||
|
||||
return $itemList;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user