From 41dfd84543f94b2f273118dea44dcb346861ff0f Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Mon, 18 Jul 2022 20:55:59 +1200 Subject: [PATCH] Ensure user creating team with custom roles is always owner as well --- app/controllers/api/teams.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/controllers/api/teams.php b/app/controllers/api/teams.php index 383bcac149..40388a8520 100644 --- a/app/controllers/api/teams.php +++ b/app/controllers/api/teams.php @@ -67,6 +67,10 @@ App::post('/v1/teams') ]))); if (!$isPrivilegedUser && !$isAppUser) { // Don't add user on server mode + if (!\in_array('owner', $roles)) { + $roles[] = 'owner'; + } + $membershipId = $dbForProject->getId(); $membership = new Document([ '$id' => $membershipId,