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 data and I have different roles to different users how can I retrieve or put a condition if this user has one of my roles it'only shows this data depends on my conditions

to explian more to get the idea I will make an example :

I have two roles x1 and x2 

and both have the same dashboard, how can I get for x1 his data without x2 data ! with same table ?


Thanks for help


Hello Yousef,

For example, you can use 2 local variables to control if the user has that role or not:
HasRole1 (True if the user has Role1, False otherwise) and HasRole2 (True if the user has Role2, False otherwise)

Then, in your aggregate, you can use these variables in your conditions and do something like:

If ( HasRole1, <Condition1>, True )
If ( HasRole2, <Condition2>, True )

Or something like:

(HasRole1 and <Condition1>) or (HasRole2 and <Condition2>)


Kind regards,

Rui Barradas

Hello Yousef.

You have CheckRole functions. Those can be used on Aggregates.

If you need more help, can you give an example of what you are trying to do?

Yousef Shraim 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 data and I have different roles to different users how can I retrieve or put a condition if this user has one of my roles it'only shows this data depends on my conditions

to explian more to get the idea I will make an example :

I have two roles x1 and x2 

and both have the same dashboard, how can I get for x1 his data without x2 data ! with same table ?


Thanks for help


Hi, 

You can check user role by CheckRoleNameRole() function in action flow. and u can retrieve data according to that role. 

You can get Users List with theirs Role by using these below systems tables.


Hope this may help

Thanks.

Rui Barradas wrote:

Hello Yousef,

For example, you can use 2 local variables to control if the user has that role or not:
HasRole1 (True if the user has Role1, False otherwise) and HasRole2 (True if the user has Role2, False otherwise)

Then, in your aggregate, you can use these variables in your conditions and do something like:

If ( HasRole1, <Condition1>, True )
If ( HasRole2, <Condition2>, True )

Or something like:

(HasRole1 and <Condition1>) or (HasRole2 and <Condition2>)


Kind regards,

Rui Barradasi

Hello Rui,

I understood what you wrote but this is not what I'm looking for I will explain more.

what I want to do is I have two types of coordinator from different department each coordinator have a different role they are filling the same form and I have combo box automatic if the user has role make my combo box choose the department automatically and cannot be changed! 

what I want to do after they submit no one can see the other department data! 

but after I read the answers I think I need to aggregate and two tables once he logged user has Role=x show this table once not show other ! is that right? 


regards 

Solution

If the form is the same, you have to use the same Entity.

Assuming your Departments are in a Static (they should if you have Roles by department)


You just need a filter of type

(Form.DepartmentId=Entities.Departments.Sales and CheckSalesRole()) or

(Form.DepartmentId=Entities.Departments.Legal and CheckLegalRole())

Each role will only see forms from one department.

Solution