Skip to content

Commit 2f53c4a

Browse files
committed
fix: template sql query has no permission
1 parent 7a368c3 commit 2f53c4a

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

apps/nestjs-backend/src/features/auth/permission.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ export class PermissionService {
319319
const tempAuthBaseId = this.cls.get('tempAuthBaseId');
320320
if (tempAuthBaseId === baseId) {
321321
const template = await this.templateModel.getTemplateRawByBaseId(baseId);
322-
return getPermissions(template ? 'viewer' : 'owner');
322+
return template ? TemplatePermissions : getPermissions('owner');
323323
}
324324
const role = await this.getRoleByBaseId(baseId);
325325
const spaceRole = await this.getRoleBySpaceId(

packages/core/src/auth/role/template.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export const TemplateRolePermission: Record<Action, boolean> = {
2626
'base|table_export': false,
2727
'base|authority_matrix_config': false,
2828
'base|db_connection': false,
29-
'base|query_data': false,
29+
'base|query_data': true,
3030
'table|create': false,
3131
'table|delete': false,
3232
'table|update': false,

0 commit comments

Comments
 (0)