π₯ π₯ π₯ A Free & Self-hostable Airtable Alternative
TypeScript airtableairtable-alternativeautomatic-apihacktoberfestlow-codeno-codeno-code-databaseno-code-platformpostgresqlrest-apirestful-apispreadsheetsqliteswagger
fix: define proper scope based on ee/ce in base create API
Pranav C83f168e141c7
diff --git a/packages/nocodb/src/controllers/v3/bases-v3.controller.ts b/packages/nocodb/src/controllers/v3/bases-v3.controller.tsindex 4ad57e8378..9e763fe32d 100644--- a/packages/nocodb/src/controllers/v3/bases-v3.controller.ts+++ b/packages/nocodb/src/controllers/v3/bases-v3.controller.ts@@ -18,14 +18,19 @@ import { MetaApiLimiterGuard } from '~/guards/meta-api-limiter.guard';import { TenantContext } from '~/decorators/tenant-context.decorator';import { NcContext, NcRequest } from '~/interface/config';import { BasesV3Service } from '~/services/v3/bases-v3.service';+import { isEE } from '~/utils';++// decide scope based on whether it's EE or CE+const BASE_SCOPE = isEE ? 'workspace' : 'org';@UseGuards(MetaApiLimiterGuard, GlobalGuard)@Controller()export class BasesV3Controller {constructor(protected readonly baseV3Service: BasesV3Service) {}- @Acl('baseList', {- scope: 'org',+ // decide permission name based on whether it's EE or CE+ @Acl(isEE ? 'workspaceBaseList' : 'baseList', {+ scope: BASE_SCOPE,})@Get('/api/v3/meta/workspaces/:workspaceId/bases')async list(@@ -91,7 +96,7 @@ export class BasesV3Controller {}@Acl('baseCreate', {- scope: 'org',+ scope: BASE_SCOPE,})@HttpCode(200)@Post('/api/v3/meta/workspaces/:workspaceId/bases')