Skip to content

Commit

Permalink
Fix bug in get permission by key (#313)
Browse files Browse the repository at this point in the history
  • Loading branch information
dangershony authored Dec 16, 2022
1 parent 121badb commit d958284
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions angular/src/shared/permission.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ export class PermissionServiceShared {

findPermissionIndexInSet(permissionSet: PermissionDomain, action: string, walletId: string, accountId: string, keyId: string) {
const permissions = permissionSet.permissions[action] as Permission[];
if (!permissions) {
return -1;
}
const permissionIndex = permissions.findIndex((p) => p.walletId == walletId && p.accountId == accountId && p.keyId == keyId);
return permissionIndex;
}
Expand Down

0 comments on commit d958284

Please sign in to comment.