FIX: Permission data manager

This commit is contained in:
Victor Radael
2022-10-03 18:07:38 -03:00
parent 166c45728f
commit 18c3c9c58c
4 changed files with 18 additions and 2 deletions
+6 -1
View File
@@ -93,12 +93,16 @@ export class CatalogController {
@Get('all')
async catalogAll(@User() user: RequestUser, @Body() body, @Query() params) {
const { user_id, customer_name, customer_id, username } = user;
const { user_id, customer_name, customer_id, username, permissions } = user;
this.logger.info(`/catalog - ON CATALOG ALL ROUTE`, {
user: body.info.user_id,
customer: body.info.customer,
});
const is_data_manager = permissions.includes(
PERMISSIONS_GROUPS.CATALOG.permissions.DATA_MANAGER.seqid,
);
const roles = await this.catalogService.getUserRolesIds(user_id);
const metadata = PackTheMetadata({
@@ -107,6 +111,7 @@ export class CatalogController {
customer_name,
username,
roles,
is_data_manager,
});
const res = await this.catalogService.getAllOpenSearchDataAssets(