Filter an aggregate based on user role [Reactive]
Application Type
Reactive

Hello everyone, 

I'm working on a project with serveral places and an user can only see the data from places that his user has access.

With that in mind, I was requested to make a role for each place, can an aggregate be filtered using the user role? If a user has roles for two places, can the aggregate show data from both plants?

Thank you

Hi Humberto,

Method 1 : You can fetch users by user role from User_Role and Role entity, then create the aggregate using joins mentioned in below screenshot.

Create role and apply filter to the aggregate

By this way you can fetch user list based on user role.

Method 2: You can apply "CheckUserRole()" to the visible property of the widget.

Note : CheckUserRole() is a server action which cannot be invoked in client action.

Hope this will helps to resolve your query.

Thanks, Aadhavan S

Thank you Aadhavan Shanmugam, I'll try method 1 (I believe method 2 will not work for filtering only the aggregate data, right?)

Filtering aggregate data is also server action.. So Yes.. method 2 also will work in different case.. but not in your case..

Hello @Humberto Matias,

This is achievable as discussed in this post by leveraging the user effective role entity.

Regards,

AJ

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.