we have a document repository that has documents for multiple departments in one list. However I need to make it so the departments can only view there items. I have tried to filter view based on department, but it is not showing the results I want. In actuality it shows the same department no matter who you are.
<Membership Type="CurrentUserGroups"><FieldRef Name="Department"/></Membership>
Here is something that you can try:
- Add a new column (example:"My Department") of type "Person or group" to the list.
- Create a SharePoint group for each department and set the department field in each item to a relevant Department sharepoint group.
- Then you can change the view query to show items based on if the user is a member of the Department group using the membership tag as shown at the top.
Assume you have 4 departments. Create 4 folders within your document library (one per department) and 4 SharePoint groups (one per department). Populate the groups with users appropriately, then assign permissions to the folders using the groups you created.
Set the default view to show a flat list of files (ignoring folders) and each user's default view will then be limited to only the files to which they have access -- the ones in their department's subfolder.
This will also let you support cross-functional users who belong to more than 1 department and thus need to see files from 2 or more.