mirror of
https://github.com/dadosfera/maestro.git
synced 2026-11-10 09:29:08 +00:00
FIX: permissions for catalog
This commit is contained in:
@@ -33,12 +33,16 @@ import {
|
||||
IUpdateDataRequest,
|
||||
} from './dtos';
|
||||
|
||||
const catalogPermissions = PERMISSIONS_GROUPS.CATALOG.permissions;
|
||||
@ApiTags('Catalog')
|
||||
@Controller('catalog')
|
||||
@Authenticated()
|
||||
@AuthenticateCondition((req, user) => {
|
||||
@AuthenticateCondition((req, user: RequestUser) => {
|
||||
if (user.permissions.includes(catalogPermissions.DATA_MANAGER.seqid))
|
||||
return true;
|
||||
|
||||
if (req.path.includes('/manage-permissions')) return true;
|
||||
let action;
|
||||
let action: keyof typeof catalogPermissions;
|
||||
|
||||
switch (req.method) {
|
||||
case 'POST':
|
||||
@@ -47,7 +51,7 @@ import {
|
||||
break;
|
||||
|
||||
default:
|
||||
action = req.method;
|
||||
action = req.method as 'GET' | 'DELETE';
|
||||
}
|
||||
|
||||
return user.permissions.includes(
|
||||
|
||||
@@ -155,7 +155,7 @@ export class PipelinesController {
|
||||
.then((res) => {
|
||||
//{pipeline:{tables: {tables: [], input_id: ''}}}
|
||||
let tables = JSON.parse(res.pipeline.config.tables);
|
||||
if (tables?.tables) tables = tables?.tables;
|
||||
if (tables?.tables) tables = tables.tables;
|
||||
Object.assign(res.pipeline, {
|
||||
transformations: res.pipeline.transformations
|
||||
? JSON.parse(res.pipeline.transformations)
|
||||
|
||||
Reference in New Issue
Block a user