From aa0a1737c8021508ecf6316001788a72c3d094b4 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Tue, 8 Oct 2024 13:16:17 +0200 Subject: [PATCH] Fix tests --- packages/server/src/api/controllers/permission.ts | 1 - packages/server/src/api/routes/tests/permissions.spec.ts | 3 +-- packages/server/src/utilities/security.ts | 1 + 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/server/src/api/controllers/permission.ts b/packages/server/src/api/controllers/permission.ts index 148cea401a..cbe260367c 100644 --- a/packages/server/src/api/controllers/permission.ts +++ b/packages/server/src/api/controllers/permission.ts @@ -1,7 +1,6 @@ import { permissions, roles, context } from "@budibase/backend-core" import { UserCtx, - Role, GetResourcePermsResponse, ResourcePermissionInfo, GetDependantResourcesResponse, diff --git a/packages/server/src/api/routes/tests/permissions.spec.ts b/packages/server/src/api/routes/tests/permissions.spec.ts index f8974f44aa..8601ed2df5 100644 --- a/packages/server/src/api/routes/tests/permissions.spec.ts +++ b/packages/server/src/api/routes/tests/permissions.spec.ts @@ -92,7 +92,7 @@ describe("/permission", () => { }) }) - it.only("should get resource permissions with multiple roles", async () => { + it("should get resource permissions with multiple roles", async () => { perms = await config.api.permission.add({ roleId: HIGHER_ROLE_ID, resourceId: table._id!, @@ -102,7 +102,6 @@ describe("/permission", () => { expect(permissions).toEqual({ read: { permissionType: "EXPLICIT", role: STD_ROLE_ID }, write: { permissionType: "EXPLICIT", role: HIGHER_ROLE_ID }, - execute: { permissionType: "BASE", role: "BASIC" }, }) const all = await config.api.permission.fetch() diff --git a/packages/server/src/utilities/security.ts b/packages/server/src/utilities/security.ts index a3353f6184..4f93c33ee4 100644 --- a/packages/server/src/utilities/security.ts +++ b/packages/server/src/utilities/security.ts @@ -19,6 +19,7 @@ export function getPermissionType(resourceId: string) { switch (docType) { case DocumentType.TABLE: case DocumentType.ROW: + return permissions.PermissionType.TABLE case DocumentType.AUTOMATION: return permissions.PermissionType.AUTOMATION case DocumentType.WEBHOOK: