mirror of
https://github.com/humhub/humhub.git
synced 2025-01-17 06:08:21 +01:00
Fix: Space module permission configuration of non installed space modules visible in permission grid
This commit is contained in:
parent
83277c95fa
commit
85ade5aed2
@ -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
|
||||
]);
|
||||
}
|
||||
|
@ -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
|
||||
*
|
||||
|
@ -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)
|
||||
|
@ -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 [];
|
||||
|
Loading…
x
Reference in New Issue
Block a user