mirror of
https://github.com/dadosfera/maestro.git
synced 2026-11-13 17:49: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(
|
||||
|
||||
Reference in New Issue
Block a user