Skip to content

Commit 0abd03e

Browse files
authored
fix: remove unneeded listGroupSlugs and listTeamSlugs methods (#4375)
1 parent 6ba635c commit 0abd03e

File tree

1 file changed

+1
-21
lines changed

1 file changed

+1
-21
lines changed

packages/api-security/src/utils/createGroupsTeamsAuthorizer/listPermissionsFromGroupsAndTeams.ts

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,11 @@ export interface GroupsTeamsAuthorizerConfig<TContext extends SecurityContext =
1212
identityType?: string;
1313

1414
/**
15-
* @deprecated Use `listGroupSlugs` instead.
15+
* @deprecated Return group slugs from the `getIdentity` function instead.
1616
* Get a group slug to load permissions from.
1717
*/
1818
getGroupSlug?: (context: TContext) => Promise<GroupSlug> | GroupSlug;
1919

20-
/**
21-
* List group slugs to load permissions from.
22-
*/
23-
listGroupSlugs?: (context: TContext) => Promise<GroupSlug[]> | GroupSlug[];
24-
25-
/**
26-
* List team slugs to load groups and ultimately permissions from.
27-
*/
28-
listTeamSlugs?: (context: TContext) => Promise<TeamSlug[]> | TeamSlug[];
29-
3020
/**
3121
* If a security group is not found, try loading it from a parent tenant (default: true).
3222
*/
@@ -65,11 +55,6 @@ export const listPermissionsFromGroupsAndTeams = async <
6555
groupSlugs.push(loadedGroupSlug);
6656
}
6757

68-
if (config.listGroupSlugs) {
69-
const loadedGroupSlugs = await config.listGroupSlugs(context);
70-
groupSlugs.push(...loadedGroupSlugs);
71-
}
72-
7358
if (identity.group) {
7459
groupSlugs.push(identity.group);
7560
}
@@ -80,11 +65,6 @@ export const listPermissionsFromGroupsAndTeams = async <
8065

8166
if (wcp.canUseTeams()) {
8267
// Load groups coming from teams.
83-
if (config.listTeamSlugs) {
84-
const loadedTeamSlugs = await config.listTeamSlugs(context);
85-
teamSlugs.push(...loadedTeamSlugs);
86-
}
87-
8868
if (identity.team) {
8969
teamSlugs.push(identity.team);
9070
}

0 commit comments

Comments
 (0)