mirror of
https://github.com/dadosfera/maestro.git
synced 2026-11-10 14:59:07 +00:00
Merge pull request #152 from dadosfera/fix/dashboards
FIX: Dashboard get all permisisons
This commit is contained in:
@@ -207,7 +207,27 @@ class CatalogService implements OnModuleInit {
|
||||
|
||||
const owner = result !== null ? result.user.username : null;
|
||||
|
||||
Object.assign(asset, { ...asset, owner });
|
||||
const roles = [];
|
||||
const users = [];
|
||||
|
||||
for (const role of customer_roles) {
|
||||
for (const role_id of asset.roles) {
|
||||
if (role.id === role_id) roles.push(role);
|
||||
}
|
||||
}
|
||||
|
||||
for (const user of customer_users) {
|
||||
for (const user_id of asset.users) {
|
||||
if (user.id === user_id) users.push(user);
|
||||
}
|
||||
}
|
||||
|
||||
Object.assign(asset, {
|
||||
...asset,
|
||||
owner,
|
||||
roles,
|
||||
users,
|
||||
});
|
||||
}
|
||||
|
||||
return { data_assets };
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user