Make different roles get different data

Make different roles get different data


I have some Table Records, and they have a lot of data. These Data are connected to different users. 

Well, the issue is:

I want to (1st) make some users see only their part of data (Field Staff), but (2nd) there are "Team Leader's" which  I want to let them see data only from his "Field Staff Team" and (3rd) there are some "Team Chief's" that have access to some Team Leader's Data (let's say 4 different Team Leader's data that belong to him, but not other 4 that do not belong him.), and finaly a (4th and last) that have access to all data.

We tried to make it only using Logic in the preparation (and it is doable for small projects), but for big projects it can become a bit unreasonable to take that path...

So, i houd appreceate a lot, any inside (even using sql, java, ...) to make this issue easier.


Nivaldo Pereira
It's an interesting issue.

My first thought is this:

I think it comes down to a good datamodel and a proper wrapper-espace.
in that espace you provide different structures as output for queries.

different roles have different actions and structures.
and in those actions you fill the list with an advanced-query and chosen output-structure.

Thanks J. for your thought.

I would appreceate others standpoint, and if possible in greater detail.

Thanks All
I agree with J - it's all about the data model.  In order to do this, the application must know how the people in your organization are related to each other - a database version of an org chart.  Typically what is done is to add a ParentUserID to the User information.  In Outsystems it is common practice to create a UserExtend entity which is a one-for-one match to the User entity which would contain these types of extra fields.  You need to create a screen to be able to set these values.  Once the data is there its easy to write an aggregate that selects data for an individual, a team leader (all ParentUserId = team leader User Id) and Team Chief (all team leaders with ParentUserId = team chief and all subordinates).  If the user has privileges for all data then just select all data.

In a project I'm working on I'm trying to create this type of mechanism that leverages the Outsystems Groups and Roles and create the parent/child relationship between roles.  That would be a more advanced way of doing this.  Unfortunately I'm really early in my design so have nothing I can show you at the moment.

Hope this helps,