M.App Enterprise Discussions

Discuss topics with other M.App Enterprise Product pioneers and experts to get the most out of it.
Showing results for 
Search instead for 
Do you mean 
New Contributor
Posts: 4
Registered: ‎12-11-2017

How to get User Roles in the workflow

Dear Community,

I need to get the user roles in order to hide/show some actions inside my workflow .


i.e. I have two roles: A and B , in my layer I have some geometries with a "type" field with a value of "A" or "B" . I have some action that both roles can perform, BUT I need to show the edit action only when the role and the type are the same.   Only role A can edit A features, only role B can edit B features, but both roles can activate the other actions.


I already can turn the visibility on/off after a session value, but if I use  {SESSION.UserRoles} I only get "System.String[]"


Do you have any suggestions?


Kind regards


New Contributor
Posts: 4
Registered: ‎12-11-2017

Re: How to get User Roles in the workflow

[ Edited ]

I find a solution that works for me.


I have an hidden actionset with autostart. In my "service" form there is a field for each role, each field has a default value of Object-Provider type (IsInRoleProvider) . This give a true or false value to the field.


The form have a script that activates a trigger for each role:


IG.vent.on('form:ready', function (form) {  	
{PLACE_HOLDER_NAME: IG.getItemById('FIELD_NAME').getValue()}}) });

Linked to this form there is a session trigger that gets the value of PLACE_HOLDER_NAME and sets a session trigger "myROLE" with value of true or false.



In my work workflow form now is possible to switch on/off the visibility of any item using this sql:


select CASE 
WHEN ({SESSION.ITEM_TYPE} = 'A' and {SESSION.my_ROLE} = 'True') THEN 'true'
WHEN ({SESSION.ITEM_TYPE} = 'B' and {SESSION.my_ROLE_2} = 'True') THEN 'true'
ELSE 'false'
END from dual


Regular Contributor
Posts: 300
Registered: ‎03-10-2016

Re: How to get User Roles in the workflow

Thanks for sharing!

GAUSS Ingenieurtechnik GmbH | Germany