mirror of
https://github.com/dadosfera/maestro.git
synced 2026-11-22 13:39:09 +00:00
FIX: Manage Permissions Catalog
This commit is contained in:
@@ -50,7 +50,12 @@ export class CatalogController {
|
||||
}
|
||||
|
||||
@Put('manage_permissions/:id')
|
||||
async manageDataAssetPermissions(@Param('id') id: string, @Body() body) {
|
||||
async manageDataAssetPermissions(
|
||||
@Param('id') id: string,
|
||||
@User() user: RequestUser,
|
||||
@Body() body,
|
||||
) {
|
||||
const response = await this.catalogService.managePermissions(body, user);
|
||||
return { message: { id, body } };
|
||||
}
|
||||
|
||||
|
||||
@@ -46,6 +46,24 @@ class CatalogService implements OnModuleInit {
|
||||
)}.dadosfera.ai`;
|
||||
}
|
||||
|
||||
async managePermissions(data: Messages.ManagePermissionRequest, metadata) {
|
||||
this.logger.info('CatalogService - getAllOpenSearchDashboard');
|
||||
|
||||
const response = await lastValueFrom(
|
||||
this.catalogWriteService.ManagePermission(data, metadata),
|
||||
)
|
||||
.then((res) => {
|
||||
this.logger.info('Done');
|
||||
return res;
|
||||
})
|
||||
.catch((err) => {
|
||||
this.logger.error(err.message);
|
||||
throw new Error(err);
|
||||
});
|
||||
|
||||
return { data_assets: response };
|
||||
}
|
||||
|
||||
async catalogAll(body) {
|
||||
const nimbusUrl = this._getNimbusUrl(body);
|
||||
const { data } = await axios.get(`${nimbusUrl}/api/catalog/all/`);
|
||||
|
||||
Reference in New Issue
Block a user