Hello everyone,

I have a problem that I can't solve. I have a Table Records, which has an Aggregate as Source.

This Table records now presents a list of existing and registered Users in the application. I intended that in this list only appeared the Users with a certain Role.

How can I filter this list by Role? What filter will I have to do in Aggregate?


I appreciate the help.

Thank you

Solution

Henrique Querido wrote:

Hello everyone,

I have a problem that I can't solve. I have a Table Records, which has an Aggregate as Source.

This Table records now presents a list of existing and registered Users in the application. I intended that in this list only appeared the Users with a certain Role.

How can I filter this list by Role? What filter will I have to do in Aggregate?


I appreciate the help.

Thank you

Hi Henrique,


You can use the User_Effective_Role entity on your aggregate.


Hope this help,

Cristiano Chamorra


Solution

Hi Henrique,

Just to complement Cristiano's answer, after adding the User_Effective_Role entity to your aggregate, you can filter by the specific Roles you want by using something like this:

To complement previous answers.

Remember that users that have SuperUser role will have ALL roles.
This means that even if you filter by a specific role, those users, usually not "real" users from the application, will appear too.

One way to eliminate those users is to create a dummy role that is not used for anything and not assign to the application users and you use it to filter out the Super Users.

Cheers.

It's done, I did it with your help! 

Thank you all

Just a question what is the difference between the User_Effective_Role and the User_Role entity?

User_Effective_Role is a view that lists all Roles assigned to a user, either directly or through user groups. User_Role contains the roles assigned to the user directly.

Thank you for the explanation!