diff --git a/protected/humhub/components/Module.php b/protected/humhub/components/Module.php index 175b06e9e1..2eefb6e973 100644 --- a/protected/humhub/components/Module.php +++ b/protected/humhub/components/Module.php @@ -48,7 +48,7 @@ class Module extends \yii\base\Module // Set settings component $this->set('settings', [ - 'class' => SettingsManager::className(), + 'class' => SettingsManager::class, 'moduleId' => $this->id ]); } diff --git a/protected/humhub/components/ModuleManager.php b/protected/humhub/components/ModuleManager.php index ad5a27193e..4be8696308 100644 --- a/protected/humhub/components/ModuleManager.php +++ b/protected/humhub/components/ModuleManager.php @@ -244,6 +244,21 @@ class ModuleManager extends Component return (array_key_exists($id, $this->modules)); } + /** + * Returns weather or not the given module id belongs to an core module. + * + * @return bool + * @since 1.3.8 + */ + public function isCoreModule($id) + { + if(!$this->hasModule($id)) { + return false; + } + + return (in_array(get_class($this->getModule($id)), $this->coreModules)); + } + /** * Returns a module instance by id * diff --git a/protected/humhub/docs/CHANGELOG.md b/protected/humhub/docs/CHANGELOG.md index 9182a32de3..303f407cad 100644 --- a/protected/humhub/docs/CHANGELOG.md +++ b/protected/humhub/docs/CHANGELOG.md @@ -7,6 +7,7 @@ HumHub Change Log --------------------------- - Fix #3359: Weekly summary e-mails are not sent in default configuration +- Fix: Space module permission configuration of non installed space modules visible in permission grid 1.3.7 (October 23, 2018) diff --git a/protected/humhub/modules/content/components/ContentContainerPermissionManager.php b/protected/humhub/modules/content/components/ContentContainerPermissionManager.php index 8c161a202b..89f2316c5f 100644 --- a/protected/humhub/modules/content/components/ContentContainerPermissionManager.php +++ b/protected/humhub/modules/content/components/ContentContainerPermissionManager.php @@ -11,6 +11,7 @@ namespace humhub\modules\content\components; use humhub\modules\user\components\PermissionManager; use humhub\modules\content\models\ContentContainerPermission; use humhub\libs\BasePermission; +use Yii; /** * @inheritdoc @@ -42,7 +43,7 @@ class ContentContainerPermissionManager extends PermissionManager */ protected function getModulePermissions(\yii\base\Module $module) { - if ($module instanceof \humhub\components\Module) { + if ($module instanceof \humhub\components\Module && (Yii::$app->moduleManager->isCoreModule($module->id) || $this->contentContainer->isModuleEnabled($module->id))) { return $module->getPermissions($this->contentContainer); } return [];