mirror of
https://github.com/nocodb/nocodb.git
synced 2026-04-25 03:55:57 +00:00
fix: define proper scope based on ee/ce in base create API
This commit is contained in:
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user