GetCurrentUser item to determine role membership
I would like to create a workflow where upon startup, I can query the roles a user belongs to and based on which group they are in, an action takes place.
I have successfully pulled this information using the GetCurrentUser but what I am not sure is how to determine what roles they belong too? For example, I know user is member of RoleA, and RoleC but how do I check for this and based on existence of a role perform an action (thinking a case select statement from my high school days of Turing). I guess I am curious how to cycle through the results and determine role membership.
Thanks in advance.
Cecil Coxen
-
'Roles' from GetCurrentUser activity is with a dataType as 'IEnumerable<string>' (refer http://www.dotnetperls.com/ienumerable-vbnet).
So you can loop Roles using 'For-Each <T>' activity (or 'Paralle For Each <T>' activity), and check which roles a Username (which is also from GetCurrentUser activity) belongs too).
Wow! you learned Turing marchin from High school? cool!.
If you explore more a new way loop thorough the collection data type, I recommend to check the Linq: http://msdn.microsoft.com/en-ca/vstudio/bb688088.aspx
Wish this helps you out.
0 -
I ended up going with the parallel activity which worked. Thank you for pointing me in the right direction. My workflow works as intended.
Cecil
0
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.
Kommentare
2 Kommentare