Skip to content

Commit

Permalink
Merge pull request #134 from humhub-contrib/fix/184-module-settings
Browse files Browse the repository at this point in the history
Improve container module settings
  • Loading branch information
luke- committed Mar 14, 2024
2 parents 5a53d24 + 1f67755 commit e107cf7
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions controllers/SettingController.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,22 @@

namespace humhub\modules\gallery\controllers;

use humhub\modules\user\models\User;
use Yii;
use humhub\modules\content\components\ContentContainerController;
use humhub\modules\content\components\ContentContainerControllerAccess;
use humhub\modules\space\models\Space;
use humhub\modules\gallery\models\forms\ContainerSettings;
use humhub\modules\space\models\Space;
use humhub\modules\user\models\User;
use Yii;

class SettingController extends ContentContainerController
{
protected function getAccessRules() {
protected function getAccessRules()
{
return [
['login'],
[ContentContainerControllerAccess::RULE_USER_GROUP_ONLY => [Space::USERGROUP_ADMIN]]
[ContentContainerControllerAccess::RULE_USER_GROUP_ONLY => [Space::USERGROUP_ADMIN, User::USERGROUP_SELF]]
];
}

public function beforeAction($action)
{
return parent::beforeAction($action);
}

public function actionIndex()
{
$settings = new ContainerSettings([
Expand All @@ -46,7 +41,6 @@ public function actionIndex()
$this->view->saved();
}


return $this->render('index', [
'settings' => $settings,
'contentContainer' => $this->contentContainer
Expand Down

0 comments on commit e107cf7

Please sign in to comment.