mirror of
https://github.com/dadosfera/maestro.git
synced 2026-08-31 19:58:21 +00:00
FIX: unitary permitting
This commit is contained in:
@@ -197,12 +197,14 @@ export class CatalogController {
|
||||
const dashboard = res.dashboard;
|
||||
|
||||
for (const role of user_roles) {
|
||||
if (dashboard.roles.includes(role)) has_permission = true;
|
||||
if (dashboard.p_roles.includes(role)) has_permission = true;
|
||||
}
|
||||
|
||||
if (dashboard.users.includes(user_id)) has_permission = true;
|
||||
if (dashboard.p_users.includes(user_id)) has_permission = true;
|
||||
|
||||
if (is_data_manager || has_permission) {
|
||||
delete res[0].p_roles;
|
||||
delete res[0].p_users;
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -247,12 +249,14 @@ export class CatalogController {
|
||||
const table = res[0];
|
||||
|
||||
for (const role of user_roles) {
|
||||
if (table.roles.includes(role)) has_permission = true;
|
||||
if (table.p_roles.includes(role)) has_permission = true;
|
||||
}
|
||||
|
||||
if (table.users.includes(user_id)) has_permission = true;
|
||||
if (table.p_users.includes(user_id)) has_permission = true;
|
||||
|
||||
if (is_data_manager || has_permission) {
|
||||
delete res[0].p_roles;
|
||||
delete res[0].p_users;
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@@ -190,7 +190,12 @@ class CatalogService implements OnModuleInit {
|
||||
}
|
||||
}
|
||||
|
||||
Object.assign(asset, { ...asset, owner, roles, users });
|
||||
Object.assign(asset, {
|
||||
...asset,
|
||||
owner,
|
||||
roles,
|
||||
users,
|
||||
});
|
||||
}
|
||||
|
||||
for (const asset of data_assets.dashboards) {
|
||||
@@ -251,6 +256,8 @@ class CatalogService implements OnModuleInit {
|
||||
Object.assign(data.dashboard, {
|
||||
tags: opensearchTable.tags,
|
||||
description: opensearchTable.description || null,
|
||||
p_roles: opensearchTable.roles,
|
||||
p_users: opensearchTable.users,
|
||||
roles,
|
||||
users,
|
||||
owner,
|
||||
@@ -312,6 +319,8 @@ class CatalogService implements OnModuleInit {
|
||||
...data[0],
|
||||
tags: opensearchTable.tags,
|
||||
table_description: opensearchTable.description,
|
||||
p_roles: opensearchTable.roles,
|
||||
p_users: opensearchTable.users,
|
||||
users,
|
||||
roles,
|
||||
owner,
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user