From 696eea9f92224cd6395d7a0821a100e7ae8911a4 Mon Sep 17 00:00:00 2001 From: Mateus Badan de Pieri Date: Fri, 14 Apr 2023 11:39:36 +0100 Subject: [PATCH] exporting function to test --- packages/backend-core/src/security/permissions.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/backend-core/src/security/permissions.ts b/packages/backend-core/src/security/permissions.ts index 1daf7d7067..dfe7988f76 100644 --- a/packages/backend-core/src/security/permissions.ts +++ b/packages/backend-core/src/security/permissions.ts @@ -55,7 +55,7 @@ export function levelToNumber(perm: PermissionLevel) { * @param {string} userPermLevel The permission level of the user. * @return {string[]} All the permission levels this user is allowed to carry out. */ -function getAllowedLevels(userPermLevel: PermissionLevel) { +export function getAllowedLevels(userPermLevel: PermissionLevel): string[] { switch (userPermLevel) { case PermissionLevel.EXECUTE: return [PermissionLevel.EXECUTE] @@ -64,9 +64,9 @@ function getAllowedLevels(userPermLevel: PermissionLevel) { case PermissionLevel.WRITE: case PermissionLevel.ADMIN: return [ + PermissionLevel.EXECUTE, PermissionLevel.READ, PermissionLevel.WRITE, - PermissionLevel.EXECUTE, ] default: return []