restrictUsersToGroup should use the entire groupPath

Signed-off-by: Casper Thygesen <cth@trifork.com>
This commit is contained in:
Casper Thygesen
2024-11-29 21:09:13 +00:00
parent db27a3f7be
commit 191e5bfae4
2 changed files with 8 additions and 3 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-catalog-backend-module-gitlab': patch
---
restrictUsersToGroup should use the entire groupPath
@@ -396,13 +396,13 @@ export class GitlabOrgDiscoveryEntityProvider implements EntityProvider {
groups = (await this.gitLabClient.listDescendantGroups(this.config.group))
.items;
const rootGroupSplit = this.config.group.split('/');
const rootGroup = this.config.restrictUsersToGroup
? rootGroupSplit[rootGroupSplit.length - 1]
const groupPath = this.config.restrictUsersToGroup
? this.config.group
: rootGroupSplit[0];
users = paginated<GitLabUser>(
options =>
this.gitLabClient.listSaaSUsers(
rootGroup,
groupPath,
options,
this.config.includeUsersWithoutSeat,
),