Apply permissions on web parts in SharePoint

 Nov 27, 2014

In Microsoft SharePoint, the only straightforward way to hide a view from public is to set it as a "Personal View." This way, only you can see the view and others can’t. This is not good enough though, because quite often you want a view to be used by certain group of users while other users see other views. Well, there is no straightforward solution to this, as views are not securable objects; however, there are a few workarounds. Each solution works for a certain situation and has some limitations. During the next few blog posts, I’m going to show you ways to achieve each of those. So here’s the first solution; Apply permissions on web parts Although you cannot set permissions on views, you can somehow apply them on web parts. So the solution is to create a web part for each view and set permissions on them. Here are the steps to do this.
  1. Create 2 views for a list and call them "View1" and "View2."
  2. Create 2 security groups, and let's call these "Titans" and "Villains."
  3. Go to the list and edit the page (using Site Action). You should now see two sections on the page. The top section is “Add a Web Part” and the bottom section showing you the list inside a Web Part.
  4. At the top right corner of the list web part, you should see a drop down arrow. Click on it and select "Edit Web Part." After a while, you should see a task pane appearing on the right hand side of the page. You may have to scroll to the right to see it.
  5. On the task pane, select the first option in the drop-down called "Selected View" and select View2. By this, you are telling the web part to show the list by its View2.
  6. Expand the "Advanced" section of the task pane, scroll down and find the box called "Target Audience." Type in Villains, which is the name of the security group you created in step 2. Click OK.
  7. Click on "Add a Web Part" at the top of the page and select your list from the list of web parts and click on the "Add" button.
  8. Repeat steps 5 to 9 to add View1 to the "Selected View" and "Titans" to "Target Audience" of the web part.
  9. Your page now has two list web parts each with a different security and view. Save your page and test it.
Of course, you can expand this to multiple views and groups. One thing you need to be aware of is that if a user is a member of both the Titans and Villains group then that user will see both views on the same page. You should make sure that the groups used for the target audience are mutually exclusive. Stand by for other ways to achieve permissions on list views!

How do your Excel skills stack up?   

Test Now  

About the Author:

Cyrus Mohseni  

Having worked within the education and training industry for over 15 years as well as the IT industry for 10 years, Cyrus brings to New Horizons a wealth of experience and skill. Throughout his career he has been involved in the development and facilitation of numerous training programs aimed at providing individuals with the skills they require to achieve formal qualification status. Cyrus is a uniquely capable trainer who possesses the ability to connect with students at all levels of skill and experience.

Read full bio
top
Back to top