diff --git a/controllers/CharactersController.inc b/controllers/CharactersController.inc index a50a2663..b36de319 100644 --- a/controllers/CharactersController.inc +++ b/controllers/CharactersController.inc @@ -37,10 +37,10 @@ * @var array */ public $permissions = array( - 'index' => array('admin', 'moderator'), + 'index' => array('admin', 'moderator', 'user'), 'character' => array('admin', 'moderator', 'user'), 'register' => array('admin', 'moderator', 'user'), - 'manage' => array('admin', 'moderator') + 'manage' => array('admin', 'moderator', 'user') ); /** * User seminary permissions @@ -307,19 +307,19 @@ switch($actions[$action]) { case _('Admin'): - if(count(array_intersect(array('admin', 'moderator'), \hhu\z\controllers\IntermediateController::$user['roles'])) <= 0 || !in_array('admin', \hhu\z\controllers\SeminaryController::$character['characterroles'])) { + if(count(array_intersect(array('admin', 'moderator'), \hhu\z\controllers\IntermediateController::$user['roles'])) <= 0 && !in_array('admin', \hhu\z\controllers\SeminaryController::$character['characterroles'])) { throw new \nre\exceptions\AccessDeniedException(); } $role = 'admin'; break; case _('Moderator'): - if(count(array_intersect(array('admin', 'moderator'), \hhu\z\controllers\IntermediateController::$user['roles'])) <= 0 || !in_array('admin', \hhu\z\controllers\SeminaryController::$character['characterroles'])) { + if(count(array_intersect(array('admin', 'moderator'), \hhu\z\controllers\IntermediateController::$user['roles'])) <= 0 && !in_array('admin', \hhu\z\controllers\SeminaryController::$character['characterroles'])) { throw new \nre\exceptions\AccessDeniedException(); } $role = 'moderator'; break; case _('User'): - if(count(array_intersect(array('admin', 'moderator'), \hhu\z\controllers\IntermediateController::$user['roles'])) <= 0 || count(array_intersect(array('admin', 'moderator'), \hhu\z\controllers\SeminaryController::$character['characterroles'])) <= 0) { + if(count(array_intersect(array('admin', 'moderator'), \hhu\z\controllers\IntermediateController::$user['roles'])) <= 0 && count(array_intersect(array('admin', 'moderator'), \hhu\z\controllers\SeminaryController::$character['characterroles'])) <= 0) { throw new \nre\exceptions\AccessDeniedException(); } $role = 'user'; diff --git a/controllers/SeminarymenuController.inc b/controllers/SeminarymenuController.inc index 1a3002c2..78c88082 100644 --- a/controllers/SeminarymenuController.inc +++ b/controllers/SeminarymenuController.inc @@ -37,6 +37,7 @@ // Set userdata $this->set('loggedUser', \hhu\z\controllers\IntermediateController::$user); $this->set('loggedSeminary', \hhu\z\controllers\SeminaryController::$seminary); + $this->set('loggedCharacter', \hhu\z\controllers\SeminaryController::$character); } diff --git a/views/html/characters/manage.tpl b/views/html/characters/manage.tpl index 15b16aa2..a70310ac 100644 --- a/views/html/characters/manage.tpl +++ b/views/html/characters/manage.tpl @@ -30,7 +30,7 @@