From bdbcf2110ea3aa6d3a8ec761806bcdf3b657ceb6 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Fri, 11 Oct 2024 17:04:29 +0100 Subject: [PATCH] Fixing an issue with screen creation - wrong base permissions were being detected for external DBs. --- packages/server/src/sdk/app/permissions/index.ts | 3 +-- packages/server/src/utilities/security.ts | 5 +++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/server/src/sdk/app/permissions/index.ts b/packages/server/src/sdk/app/permissions/index.ts index 97af9ccc83..7c385864f4 100644 --- a/packages/server/src/sdk/app/permissions/index.ts +++ b/packages/server/src/sdk/app/permissions/index.ts @@ -73,8 +73,7 @@ export async function getResourcePerms( p[level] = { role, type: PermissionSource.BASE } return p }, {}) - const result = Object.assign(basePermissions, permissions) - return result + return Object.assign(basePermissions, permissions) } export async function getDependantResources( diff --git a/packages/server/src/utilities/security.ts b/packages/server/src/utilities/security.ts index 4f93c33ee4..7cfbeb197c 100644 --- a/packages/server/src/utilities/security.ts +++ b/packages/server/src/utilities/security.ts @@ -1,5 +1,5 @@ -import { permissions, roles } from "@budibase/backend-core" -import { DocumentType, VirtualDocumentType } from "../db/utils" +import { DocumentType, permissions, roles } from "@budibase/backend-core" +import { VirtualDocumentType } from "../db/utils" import { getDocumentType, getVirtualDocumentType } from "@budibase/types" export const CURRENTLY_SUPPORTED_LEVELS: string[] = [ @@ -19,6 +19,7 @@ export function getPermissionType(resourceId: string) { switch (docType) { case DocumentType.TABLE: case DocumentType.ROW: + case DocumentType.DATASOURCE_PLUS: return permissions.PermissionType.TABLE case DocumentType.AUTOMATION: return permissions.PermissionType.AUTOMATION