Show a View on a Form based on an AD Group Membership.

  • 26 September 2014
  • 1 reply
  • 8 views

Badge +4

Hi All, 

 

Is it possible to have a view on a smartform only display if the current user is a member of a specific AD Group?

 


1 reply

Badge +10

 

Sure.  This is how I did it.  I built a SmartObject off the AD Service 2 Service Object but I guess you could use the prebuilt Task Allocation/Users and Groups/Get Email For Group Users SmartObject.  Test it out using the SmartObject Services Tester tool.

 

Added a data Label to the form that will be populated with the users name if they are a member of the group.  When the form opens it calls the SmartObject method that returns all the users for that group and filters on the current users networkID and populates the Data Label with the value.  If the user is not part of that group it will be blank.  Then there is a rule to hide the view if the data label is blank.

 

When the Form is Initializing
  then on Demo AD User SmartObject, execute its GetUsersByGroup method (configure)   *** this populates the data label filtering by the current users Name from the Context Browser in System Value/Current User
    if Data Label does not contain a value
          then hide vSecuredView View
   then on vSecuredView View, execute the Initialize method (configure)

Reply