From 08d588aeb1cf5d1ee79747fdf58cc1b35aa75169 Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Wed, 15 Mar 2023 11:55:21 +0100 Subject: [PATCH] fix: remove unnecessary owner check --- app/controllers/api/teams.php | 9 --------- 1 file changed, 9 deletions(-) diff --git a/app/controllers/api/teams.php b/app/controllers/api/teams.php index 81efc097ee..4afff2d653 100644 --- a/app/controllers/api/teams.php +++ b/app/controllers/api/teams.php @@ -300,15 +300,6 @@ App::put('/v1/teams/:teamId/prefs') throw new Exception(Exception::TEAM_NOT_FOUND); } - $roles = Authorization::getRoles(); - $isPrivilegedUser = Auth::isPrivilegedUser($roles); - $isAppUser = Auth::isAppUser($roles); - $isOwner = Authorization::isRole("team:{$team->getId()}/owner"); - - if (!$isOwner && !$isPrivilegedUser && !$isAppUser) { - throw new Exception(Exception::USER_UNAUTHORIZED, 'User is not allowed to update preferences for this team'); - } - $team = $dbForProject->updateDocument('teams', $team->getId(), $team->setAttribute('prefs', $prefs)); $events->setParam('teamId', $team->getId());