Skip to main content

Hi,

 

Can anyone tell me how to do an Advanced Condition in a Rule to check if the currently logged in user is a member of a AD Group while the form is initilaizing?

If not send them to a resting page.

 

I know how to do the advanced condition to check if the current user is = a particular user (so i know how to lock the form down to only certain users, but i want to do do a blanket rule to only allow users who are a member of a group to access the form.

 

I also know how to send them onto a resting page with navigate to another form, its just the initial how to check if current user is a member of an AD group i'm stuck on

 

Thank You

Sharp,


 


Your probably going to have to create a new AD Group smartobject to bring in the methods you'll need for getting user data out of them.


 


K2 designer > Create Advanced SmO > Pull in Active Directory Group V2 methods.


 


16580iD2DFF09C1299281B.png


 


Once that is in place, you can fire the GetGroupsByUser method with the input of the username, a filter of the group your looking for and an output of a datalable.


 


If the datalable changes, you can fire a condition that if true to navigate them to another form.


 


In the below example, the datalabes will only fill if the filter evaluates to true.  I can then create a navigation rule.


 


11446iB1C5F4A6FF47FFFA.png


Ooooor,


 


I also rebuilt my AD Users smartobject to pull in more methods.  You can fire (from the user side) the GetUsersByGroup method.  If you have an input of the group your looking for and a filter out the Name property of the user ID, then you can also evaluate to true/false.


 


14579i4F04C994E5DEAAF2.png


Thanks for the info Dave,

 

Question is, if I'm doing this lookup on initialization and I have an AD Group which consists of 80000+ users, won't think slow the load screen while it looks up the user?


When I preform list methods with search criteria in them, I don't commonly see slow-downs.  That method I firied in the demo went off within .03 miliseconds.


Reply