From 1e3f25c0cf41f50fd81c4f0847c7a7a0c5881472 Mon Sep 17 00:00:00 2001 From: coderkun Date: Tue, 8 Jul 2014 13:55:48 +0200 Subject: [PATCH] allow Seminary moderators to access all Achievement media --- controllers/MediaController.inc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/controllers/MediaController.inc b/controllers/MediaController.inc index 4c128fc9..1013c48b 100644 --- a/controllers/MediaController.inc +++ b/controllers/MediaController.inc @@ -249,8 +249,10 @@ switch($locked) { case null: - if(is_null($character) || !$this->Achievements->hasCharacterAchievedAchievement($achievement['id'], $character['id'])) { - throw new \nre\exceptions\AccessDeniedException(); + if(count(array_intersect(array('admin', 'moderator'), \hhu\z\controllers\SeminaryController::$character['characterroles'])) == 0) { + if(is_null($character) || !$this->Achievements->hasCharacterAchievedAchievement($achievement['id'], $character['id'])) { + throw new \nre\exceptions\AccessDeniedException(); + } } $index = 'achieved_achievementsmedia_id'; break;