Fixed missing imports in admin module permissions

This commit is contained in:
Lucas Bartholemy 2017-01-23 18:03:46 +01:00
parent ba74c0fd9b
commit df38c021c2

View File

@ -2,13 +2,15 @@
/** /**
* @link https://www.humhub.org/ * @link https://www.humhub.org/
* @copyright Copyright (c) 2015 HumHub GmbH & Co. KG * @copyright Copyright (c) 2017 HumHub GmbH & Co. KG
* @license https://www.humhub.com/licences * @license https://www.humhub.com/licences
*/ */
namespace humhub\modules\admin; namespace humhub\modules\admin;
use Yii; use Yii;
use humhub\modules\user\models\User;
use humhub\modules\space\models\Space;
/** /**
* Admin Module * Admin Module
@ -35,29 +37,31 @@ class Module extends \humhub\components\Module
* @var boolean is marketplace enabled? * @var boolean is marketplace enabled?
*/ */
public $marketplaceEnabled = true; public $marketplaceEnabled = true;
/** /**
* @inheritdoc * @inheritdoc
*/ */
public $resourcesPath = 'resources'; public $resourcesPath = 'resources';
/** /**
* @var boolean check daily for new HumHub version * @var boolean check daily for new HumHub version
*/ */
public $dailyCheckForNewVersion = true; public $dailyCheckForNewVersion = true;
/**
* @inheritdoc
*/
public function getName() public function getName()
{ {
return Yii::t('AdminModule.base', 'Admin'); return Yii::t('AdminModule.base', 'Admin');
} }
/** /**
* @inheritdoc * @inheritdoc
*/ */
public function getPermissions($contentContainer = null) public function getPermissions($contentContainer = null)
{ {
if ($contentContainer instanceof \humhub\modules\space\models\Space) { if ($contentContainer instanceof Space) {
return []; return [];
} elseif ($contentContainer instanceof User) { } elseif ($contentContainer instanceof User) {
return []; return [];
@ -76,13 +80,14 @@ class Module extends \humhub\components\Module
/** /**
* @inheritdoc * @inheritdoc
*/ */
public function getNotifications() public function getNotifications()
{ {
if(Yii::$app->user->isAdmin()) { if (Yii::$app->user->isAdmin()) {
return [ return [
'humhub\modules\admin\notifications\NewVersionAvailable' 'humhub\modules\admin\notifications\NewVersionAvailable'
]; ];
} }
return []; return [];
} }
} }