Skip to content

Commit

Permalink
fix(rbac): fix sonar cloud issues for rbac-backend plugin (janus-idp#…
Browse files Browse the repository at this point in the history
…1619)

Signed-off-by: Oleksandr Andriienko <oandriie@redhat.com>
  • Loading branch information
AndrienkoAleksandr committed May 14, 2024
1 parent bd92be8 commit bf93354
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions plugins/rbac-backend/src/role-manager/ancestor-search-memo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@ export class AncestorSearchMemo {
return;
}

const groupsRefs = new Set<string>();
const groupName = `group:${group.metadata.namespace?.toLocaleLowerCase(
'en-US',
)}/${group.metadata.name.toLocaleLowerCase('en-US')}`;
Expand All @@ -161,13 +160,12 @@ export class AncestorSearchMemo {
if (parentGroup) {
const parentName = `group:${group.metadata.namespace?.toLocaleLowerCase(
'en-US',
)}/${parent.toLocaleLowerCase('en-US')}`;
)}/${parentGroup.metadata.name.toLocaleLowerCase('en-US')}`;
memo.setEdge(parentName, groupName);
groupsRefs.add(parentName);
}

if (groupsRefs.size > 0 && memo.isAcyclic()) {
this.traverseGroups(memo, parentGroup!, allGroups, depth);
if (memo.isAcyclic()) {
this.traverseGroups(memo, parentGroup, allGroups, depth);
}
}
}

Expand All @@ -194,7 +192,7 @@ export class AncestorSearchMemo {
);

if (parentGroup && memo.isAcyclic()) {
this.traverseRelations(memo, parentGroup!, allRelations, depth);
this.traverseRelations(memo, parentGroup, allRelations, depth);
}
}

Expand Down

0 comments on commit bf93354

Please sign in to comment.