From b9844046ecf4b296719e1a6d45aab2256818ecab Mon Sep 17 00:00:00 2001 From: Yuriy Bakhtin Date: Thu, 14 Mar 2024 15:19:21 +0100 Subject: [PATCH 1/2] Improve container module settings --- controllers/ContainerConfigController.php | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/controllers/ContainerConfigController.php b/controllers/ContainerConfigController.php index feefbdd0..9f1050c3 100644 --- a/controllers/ContainerConfigController.php +++ b/controllers/ContainerConfigController.php @@ -15,19 +15,16 @@ namespace humhub\modules\calendar\controllers; - -use humhub\modules\admin\permissions\ManageSpaces; -use humhub\modules\calendar\permissions\ManageEntry; +use humhub\modules\content\components\ContentContainerControllerAccess; +use humhub\modules\space\models\Space; class ContainerConfigController extends AbstractConfigController { /** * @inheritdoc */ - public function getAccessRules() + protected function getAccessRules() { - return [ - ['permission' => [ManageSpaces::class, ManageEntry::class]] - ]; + return [[ContentContainerControllerAccess::RULE_USER_GROUP_ONLY => [Space::USERGROUP_ADMIN]]]; } -} \ No newline at end of file +} From 0251d0998cbea8127a3db63a8a61b174efc8409c Mon Sep 17 00:00:00 2001 From: Yuriy Bakhtin Date: Thu, 14 Mar 2024 15:43:20 +0100 Subject: [PATCH 2/2] Improve container module settings --- controllers/ContainerConfigController.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/controllers/ContainerConfigController.php b/controllers/ContainerConfigController.php index 9f1050c3..4cef5ea0 100644 --- a/controllers/ContainerConfigController.php +++ b/controllers/ContainerConfigController.php @@ -17,6 +17,7 @@ use humhub\modules\content\components\ContentContainerControllerAccess; use humhub\modules\space\models\Space; +use humhub\modules\user\models\User; class ContainerConfigController extends AbstractConfigController { @@ -25,6 +26,6 @@ class ContainerConfigController extends AbstractConfigController */ protected function getAccessRules() { - return [[ContentContainerControllerAccess::RULE_USER_GROUP_ONLY => [Space::USERGROUP_ADMIN]]]; + return [[ContentContainerControllerAccess::RULE_USER_GROUP_ONLY => [Space::USERGROUP_ADMIN, User::USERGROUP_SELF]]]; } }