From bd10a3d831b0e97fe5df2090d9ceed4e127ff76e Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Thu, 17 Oct 2024 17:00:40 +0100 Subject: [PATCH] Missed comment. --- packages/backend-core/src/security/roles.ts | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/packages/backend-core/src/security/roles.ts b/packages/backend-core/src/security/roles.ts index 366e74bec5..56037f7403 100644 --- a/packages/backend-core/src/security/roles.ts +++ b/packages/backend-core/src/security/roles.ts @@ -273,12 +273,7 @@ export async function roleToNumber(id: string) { } return 0 } - let highest = 0 - for (let role of hierarchy) { - const roleNumber = findNumber(role) - highest = Math.max(roleNumber, highest) - } - return highest + return Math.max(...hierarchy.map(findNumber)) } /**