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