Fix tests

This commit is contained in:
Adria Navarro 2024-10-08 13:16:17 +02:00
parent 9f84262940
commit aa0a1737c8
3 changed files with 2 additions and 3 deletions

View File

@ -1,7 +1,6 @@
import { permissions, roles, context } from "@budibase/backend-core"
import {
UserCtx,
Role,
GetResourcePermsResponse,
ResourcePermissionInfo,
GetDependantResourcesResponse,

View File

@ -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()

View File

@ -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: