Skip to content

Commit

Permalink
fix(rbac): fix uncommited knex transaction in the addGroupingPolicies (
Browse files Browse the repository at this point in the history
…janus-idp#1968)

Signed-off-by: Oleksandr Andriienko <[email protected]>
  • Loading branch information
AndrienkoAleksandr authored Jul 29, 2024
1 parent a099514 commit 24d5eef
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions plugins/rbac-backend/src/service/enforcer-delegate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,12 @@ export class EnforcerDelegate {
policies: string[][],
externalTrx?: Knex.Transaction,
): Promise<void> {
const trx = externalTrx || (await this.knex.transaction());

if (policies.length === 0) {
return;
}

const trx = externalTrx || (await this.knex.transaction());

try {
const ok = await this.enforcer.addPolicies(policies);
if (!ok) {
Expand Down

0 comments on commit 24d5eef

Please sign in to comment.