Hello,
For my application, I have a project savings table and for each project savings/datapoint, it has its own Business Code (e.g. ABC/DEF/GHI/etc...). So I would like for there to be a role for the user to be able:
To view all project savings/datapoint with the Business code of "ABC" only for example. Basically allowing the user to view the data based on a attribute. So I have this filters for the aggregate:
1) CheckAdministratorRole(UserId:) = True or CheckABCManagerRole(UserId:) = True or ProjectSavings.UserId = GetUserId()
2) If(CheckABCManagerRole(UserId:) = True,BusinessUnits.Label = "ABC",BusinessUnits.Label like "%" + SearchText5 + "%")
This seems to be partially working as the ABCManager can only see those data with ABC Business Code, however, the users with the admin role can only see the same data as the ABCManager instead of being able to view every data. Is there a solution to this or better yet a more elegant solution to my issue? Thank you!
If you are using these two lines you mentioned as two filters so when aggregate executed it will apply and between two filters (condition) so everyone will see only projects with BusinessUnits.Label = "ABC"
1) CheckAdministratorRole(UserId:) = True or (CheckABCManagerRole(UserId:) = True and BusinessUnits.Label = "ABC" ) or ProjectSavings.UserId = GetUserId()
You will need to arrange your filters again by combining two lines of filters into one line using or/ and. you can try following filter
Otherwise you can use fetch data action and use inside it if condition based on user role you will have two branches one for admin which is aggregate will display all projects without filter BusinessUnits.Label = "ABC" and another branch for ABC manager which has aggregate with filter BusinessUnits.Label = "ABC"
Thank you so much for your help! The filter worked great! I am interested in testing/trying out the data action method too. Thank you for that suggestion! I appreciate it!
Great news!
Good luck