Skip to content

Commit 605b5a6

Browse files
committed
[HMSDEV-213] Allowing groups to be created in /, not sharing projects with group if created in group
1 parent 58396c7 commit 605b5a6

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Models/GitLab/GitLabPlatform.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,9 @@ public function addRepository(array $properties, ?GitOwnerInterface $owner = nul
103103
);
104104

105105
if ($owner instanceof GitTeamInterface) {
106-
$repo->grantTeamAccess($owner);
106+
if ($owner->id !== $parent) {
107+
$repo->grantTeamAccess($owner);
108+
}
107109
} elseif ($owner->id !== $currentUser->id) {
108110
$repo->grantUserAccess($owner);
109111
}
@@ -195,7 +197,7 @@ public function addTeam(array $properties): GitTeamInterface
195197
$name = basename($path);
196198
$properties['name'] = $name;
197199

198-
$parent = $this->findOrCreateGroup($prefix);
200+
$parent = ($prefix !== '.') ? $this->findOrCreateGroup($prefix) : null;
199201

200202
GitLabTeam::validateAdd($properties);
201203
return $this->client->addModelInstance(

0 commit comments

Comments
 (0)