Skip to main content


 

Symptoms


I want to make controls read only when a user is not apart of a specific group.
 

Diagnoses


Possible via the SharePoint site's 'User' SmartObject 'Get Groups For User' method and some Form rules.
 

Resolution

- Create a text parameter named UserGroupReturned.
- Add an 'Execute a SmartObject method' action to your 'When the Form is Initializing' rule, targeting 'SharePoint 2013Your.Site.CollectionManagementUser' SmartObject, passing in 'System Values -> Current User -> Name' (which is in the format of domainusername) to 'User Login Name'.
- For filters, specify 'Group Title' Equals YourSharePointGroupName (this will return a string value equal to the group name passed in if the user is a member of said group).
- In Output Mappings, drag 'Group Title' into the form parameter 'UserGroupReturned'.
- Add a conditional statement 'if Form parameter UserGroupReturned has not been specified' followed by some 'Set a Form/View control's properties', which set your targeted controls to read-only.




 
Be the first to reply!

Reply