Skip to content

Commit 7eabb43

Browse files
committed
fix: i forgot to test reloading
1 parent de58866 commit 7eabb43

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

packages/backend/src/services/auth/PermissionService.js

+6-3
Original file line numberDiff line numberDiff line change
@@ -716,18 +716,21 @@ class PermissionService extends BaseService {
716716
}
717717

718718
async get_higher_permissions (permission) {
719-
const higher_perms = [];
719+
const higher_perms = new Set()
720+
higher_perms.add(permission);
721+
720722
const parent_perms = this.get_parent_permissions(permission);
721723
for ( const parent_perm of parent_perms ) {
724+
higher_perms.add(parent_perm);
722725
for ( const exploder of this._permission_exploders ) {
723726
if ( ! exploder.matches(parent_perm) ) continue;
724727
const perms = await exploder.explode({
725728
permission: parent_perm,
726729
});
727-
higher_perms.push(...perms);
730+
for ( const perm of perms ) higher_perms.add(perm);
728731
}
729732
}
730-
return higher_perms;
733+
return Array.from(higher_perms);
731734
}
732735

733736
get_parent_permissions (permission) {

0 commit comments

Comments
 (0)