Skip to content

Commit

Permalink
Bug visibilidad de datasoures para admin (los tineen que ver)
Browse files Browse the repository at this point in the history
  • Loading branch information
jortilles committed Nov 29, 2023
1 parent 985dd20 commit c5fd94f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions eda/eda_api/lib/module/dashboard/dashboard.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1016,6 +1016,10 @@ export class DashboardController {

/**Check if an user can or not see a data model. */
static securityCheck(dataModel: any, user: any) {
/** un admin lo ve todo */
if( user.role.includes('135792467811111111111110') ){
return true;
}
if (dataModel.ds.metadata.model_granted_roles.length > 0) {
const users = []
const roles = []
Expand Down
2 changes: 1 addition & 1 deletion eda/eda_api/lib/module/datasource/datasource.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export class DataSourceController {
}
});

if (users.includes(userID) || roles.length > 0 || allCanSee == 'true') {
if (users.includes(userID) || roles.length > 0 || allCanSee == 'true' || req.user.role.includes('135792467811111111111110') /* admin role los admin lo ven todo*/ ) {
output.push({ _id: e._id, model_name: e.ds.metadata.model_name });
}

Expand Down

0 comments on commit c5fd94f

Please sign in to comment.