Is there a way to manage permissions based on a value in a field. For example I have a master list of store locations with who works at those stores, then I have a list of sales with each store location. I only want the manager to be able to see the information in the list that pertains to their store. Is this possible?
2 Answers
You can create SharePoint groups for each of the stores, then create an event receiver that sets the permissions dynamically on the item to the group belongs to the selected value based on the value in your field.
In your master list of store locations you shuld add a new field of type Person or Group
and set the corresponding group in this field. This will enable to look up the group easily in your event receiver. Add the managers (and their delegations / replacements) to the groups.
-
-
@Zeth you can create event receivers in Visual Studio. More here: msdn.microsoft.com/en-us/library/ee231563.aspx– BioGeneZCommented Feb 9, 2015 at 14:29
Yes, it's possible. But you should set item-level permission for those lists. You can use event receivers (custom code), or SharePoint workflows.
-
How would sharepoint workflows work? Can you provide an example possibly?– ZethCommented Feb 9, 2015 at 14:22
-
How to Create a Workflow to Change Item Level Permissions - spcycle.blogspot.ru/2012/01/…– BioGeneZCommented Feb 9, 2015 at 14:27
-
I followed the steps and published the work flow and had a user test, the user still was able to see all of the items in the list even though they were set up only to see only that of a single location. Any ideas?– ZethCommented Feb 9, 2015 at 19:20