I am working on a site in sharepoint 2010 and have an infopath form attached to a list. The form has two views a user view, for users to enter in information and an admin view that contains fields only for admins to fill out. I want to be able to only allow users who belong to a certain permissions group to be able to see the admin view in the form as well as automatically switch to the admin view if an admin is editing the item in the list. Is there a way to set the view depending on permission group while also preventing non admins from accessing the view in the form?
The basic idea is that you'll need to create a data connection to your groups using
UserGroup.asmx to query if the current user is member, according to the result you can add the proper rules.
for more details about the steps please check the below :
A. Saeed, you are the first person in about 100 posts I've read that fixed this for InfoPath 2013. AMAZING.
<s:elementname="tns:GetUserCollectionFromGroup" type="tns:GetUserCollectionFromGroupType"></s:element> , with
<s:element name="GetUserCollectionFromGroup" type="tns:GetUserCollectionFromGroupType" />
This is the fix for InfoPath 2013