mirror of
https://github.com/dadosfera/maestro.git
synced 2026-11-10 20:59:08 +00:00
FIX: data asset owner
This commit is contained in:
@@ -16,10 +16,10 @@ export class CatalogClientConfiguration {
|
||||
Catalog.ProtoPackages.ReadPackage,
|
||||
Catalog.ProtoPackages.WritePackage,
|
||||
],
|
||||
credentials:
|
||||
process.env.LOCAL_ENV || process.env.ENV === 'local'
|
||||
? undefined
|
||||
: credentials.createSsl(),
|
||||
// credentials:
|
||||
// process.env.LOCAL_ENV || process.env.ENV === 'local'
|
||||
// ? undefined
|
||||
// : credentials.createSsl(),
|
||||
protoPath: [
|
||||
Catalog.ProtoPaths.ReadFilePath,
|
||||
Catalog.ProtoPaths.WriteFilePath,
|
||||
|
||||
@@ -59,7 +59,6 @@ class CatalogService implements OnModuleInit {
|
||||
return lastValueFrom(
|
||||
this.catalogWriteService.ManagePermission(data, metadata),
|
||||
).catch((err) => {
|
||||
console.log(err.details);
|
||||
throw new HttpException(
|
||||
err.details,
|
||||
err.code === 6 ? HttpStatus.CONFLICT : 404,
|
||||
@@ -73,7 +72,6 @@ class CatalogService implements OnModuleInit {
|
||||
return lastValueFrom(
|
||||
this.catalogWriteService.RevokePermission(data, metadata),
|
||||
).catch((err) => {
|
||||
console.log(err.details);
|
||||
throw new HttpException(
|
||||
err.details,
|
||||
err.code === 6 ? HttpStatus.CONFLICT : 404,
|
||||
@@ -116,8 +114,6 @@ class CatalogService implements OnModuleInit {
|
||||
|
||||
const roles_ids = result.user.roles.map((role) => role.id);
|
||||
|
||||
console.log(roles_ids);
|
||||
|
||||
return roles_ids;
|
||||
}
|
||||
|
||||
@@ -140,10 +136,11 @@ class CatalogService implements OnModuleInit {
|
||||
});
|
||||
|
||||
for (const asset of response.tables) {
|
||||
const result =
|
||||
asset.owner && !asset.owner.includes('@')
|
||||
? await this.userService.findOneById(asset.owner)
|
||||
: null;
|
||||
const condition =
|
||||
asset.owner && !asset.owner.includes('@') ? true : false;
|
||||
const result = condition
|
||||
? await this.userService.findOneById(asset.owner)
|
||||
: null;
|
||||
|
||||
const owner = result !== null ? result.user.username : null;
|
||||
|
||||
@@ -151,13 +148,13 @@ class CatalogService implements OnModuleInit {
|
||||
}
|
||||
|
||||
for (const asset of response.dashboards) {
|
||||
const result =
|
||||
asset.owner && !asset.owner.includes('@')
|
||||
? await this.userService.findOneById(asset.owner)
|
||||
: null;
|
||||
const condition =
|
||||
asset.owner && !asset.owner.includes('@') ? true : false;
|
||||
const result = condition
|
||||
? await this.userService.findOneById(asset.owner)
|
||||
: null;
|
||||
|
||||
const owner = result !== null ? result.user.username : null;
|
||||
console.log(asset.owner, result.user.username, owner);
|
||||
|
||||
Object.assign(asset, { ...asset, owner });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user