none
How to Restrict Permissions on List Views? RRS feed

  • Question

  • I have a custom list containing employee information, which also consists of their private information such as social security numbers and dates of birth. I want to have 2 list views: public and private. Public will display only the columns containing generic information without any private information. Private will show everything. How do I restrict permissions on the private view so that only a specified group of users can view it?
    Thursday, December 2, 2010 12:17 AM

Answers

  • This is possible by using audience targeting feature. Create as many view as you want and bind all views one by one in list AllItems view(Allitems.aspx).  While adding the view in AllItems page you have to do the audience targeting. Below are details steps.

    1. Create view A, B, C foe list TestList

    2. Create user group X, Y, Z

    3. Open the TestList, bu default all items will display in AllItems.aspx page

    4. Edit the page by using Site Action

    5. Click on the Modify Shared Web Part link of TestList . Now select the View A from selected dropdown

    6. Go to Advanced section and select user group in the target audience. Apply the changes

    7. Add the TestList web part again to the same AllItems.aspx page.

    7. Repeat the step 5 and 6 for other two views and set the target audience respectively.

    8. Now the AllItems.aspx page will have three web part for one list i.e TestList

     

    Note: It has some limitation, you will come to know when you follow above steps.

    Hope this will solve your problem.

     


    Senthilrajan Kaliyaperumal
    • Marked as answer by Leoyi Sun Thursday, December 9, 2010 2:55 AM
    Thursday, December 2, 2010 5:05 AM
  • The short answer is that you can't.  Permissions are set on the list level, not any lower to things like fields or views. 

    The long answer is that there are lots of different tricks to make it look like you're granting view/field types of permissions, but as long as the data is in the same list, you need to grant access to those users or to a service account, etc...

    You could do something like put the private data in a different list or database and link the lists/data sources together with data views or custom web parts, but that's getting a little iffy on whether you should be mixing processes like that. 

    Wes


    SharePoint Consultant | SharePoint MVP | My Blog | Minnesota SharePoint User Grop (MNSPUG)
    • Marked as answer by Leoyi Sun Thursday, December 9, 2010 2:55 AM
    Thursday, December 2, 2010 2:07 AM

All replies

  • The short answer is that you can't.  Permissions are set on the list level, not any lower to things like fields or views. 

    The long answer is that there are lots of different tricks to make it look like you're granting view/field types of permissions, but as long as the data is in the same list, you need to grant access to those users or to a service account, etc...

    You could do something like put the private data in a different list or database and link the lists/data sources together with data views or custom web parts, but that's getting a little iffy on whether you should be mixing processes like that. 

    Wes


    SharePoint Consultant | SharePoint MVP | My Blog | Minnesota SharePoint User Grop (MNSPUG)
    • Marked as answer by Leoyi Sun Thursday, December 9, 2010 2:55 AM
    Thursday, December 2, 2010 2:07 AM
  • This is possible by using audience targeting feature. Create as many view as you want and bind all views one by one in list AllItems view(Allitems.aspx).  While adding the view in AllItems page you have to do the audience targeting. Below are details steps.

    1. Create view A, B, C foe list TestList

    2. Create user group X, Y, Z

    3. Open the TestList, bu default all items will display in AllItems.aspx page

    4. Edit the page by using Site Action

    5. Click on the Modify Shared Web Part link of TestList . Now select the View A from selected dropdown

    6. Go to Advanced section and select user group in the target audience. Apply the changes

    7. Add the TestList web part again to the same AllItems.aspx page.

    7. Repeat the step 5 and 6 for other two views and set the target audience respectively.

    8. Now the AllItems.aspx page will have three web part for one list i.e TestList

     

    Note: It has some limitation, you will come to know when you follow above steps.

    Hope this will solve your problem.

     


    Senthilrajan Kaliyaperumal
    • Marked as answer by Leoyi Sun Thursday, December 9, 2010 2:55 AM
    Thursday, December 2, 2010 5:05 AM
  • Senthilrajan or anyone who happens to wander by:

    I am in a bit of a panic -- I tried to implement the solution above for a site that I'm setting up that has to go live in the next couple of days.  (Nothing like waiting until the last minute.) 

    I followed all the steps above, but when I change the "selected view" to one of my A, B or C views, it doesn't seem to "stick".  I change the view, hit the "Apply" button and then save, but when I reopen the "modify shared webpart" dialog, the value in the "selected view" field is still "<current view>".

    I understand that this solution is a workaround for an OOB functionality that doesn't really exist in Sharepoint; however, I need for all my data to be in a single list, and to have user groups that are restricted by views to see ONLY the data that pertains to them.  I can't create separate lists and roll them up into one for reporting.  I have another team that needs to pull data from ONE list every night, so I need all the items to be in the same list.

    Any assistance will be most appreciated.

    Thanks very much,

    Julie

    Thursday, July 19, 2012 8:52 PM
  • A few thoughts: -

    1 - Are you applying this to a page that needs to be checked out, or are you using the default allitems.aspx

    2 - Have you tried using another browser?  Sometimes JScript errors stop any changes being saved back to pages within IE (for me at least).


    Steven Andrews | SharePoint Professional | http://www.twitter.com/backpackerd00d | https://baron72.wordpress.com/

    Friday, July 20, 2012 11:01 AM
    Answerer
  • Hi,

    Thanks for your post...

    Its really work.....

    Regards

    Parveen Goyal

    Tuesday, December 18, 2012 9:53 AM
  • Hi Julie,

    I am having the same problem the value in the "selected view" does not "stick". I read Stevens reply but do not understand. Would you be so kind in directing me on how to solve this problem.

    Thanks for all your help.

    Wednesday, October 9, 2013 3:40 PM
  • I have managed to restrict user views as well based on target audiences, as mentioned above. Essentially, you put the list view part in its own page and expose it to a particular group of people, the disable the ribbon, so all they see is what you tell them to see. If you're concerned about people not even seeing the data, one thing I've managed to do as well is creating a workflow as soon as an item is created (or modified, for that matter) that will set permissions on that list item to a certain group of folks based on whatever criteria they select. For example, on a customer-service list, you can set a workflow to assign contribute permissions to only the author and the customer-service team as soon as that item is added. This way, you only see your stuff and the customer-service group sees everything else. You can do all sorts of fun AD integration on the backend based on roles and such as part of your workflow, and that way your view may just be me permissions-based depending on who has access to see what. Makes sense? Hope that helps.
    Friday, October 18, 2013 2:45 AM
  • This seems to be to a relatively simple way that doesn't allow any working around the permissions.  You do need to use SharePoint Designer, but it is easy enough to do:

    www.casualcoder.com/how-to-set-permissions-on-sharepoint-list-view

    I can't take the credit, but tested it and it worked for me in SP2007; the blog poster did it in SP2010.

    Tuesday, February 10, 2015 3:18 PM
  • Unless Senthilrajan is leaving out important details, that solution ignores the security concerns of the question. Targeting audiences on a webpart doesn't restrict columns within a list. The view may only show the desired columns, but the user can still open the related items and see everything, as Wes pointed out.
    • Proposed as answer by PCHS007 Monday, March 5, 2018 3:24 PM
    Wednesday, November 4, 2015 8:35 PM
  • This is a great solution if the users have read permission only. If they have Contribute permission or higher then they have the ability to create their own view and hence will defeat the purpose. 

    AMG

    Sharepoint 2013 on-prem

    • Proposed as answer by Alcide Sunday, November 8, 2015 3:12 AM
    • Unproposed as answer by Steven AndrewsEditor Thursday, December 3, 2015 11:47 AM
    Sunday, November 8, 2015 2:27 AM
  • This is a great solution too, I never thought to use workflows to manage permissions on items. We have a list that should only show items to a specific user group after a date field has been updated, this would be a perfect solution for that situation.


    Joshua Gadbois, Sr.

    Wednesday, March 22, 2017 7:36 PM
  • I know this is way late, but once you change the view by editing the web part, when you open the web part editing pane again, it will say "current view"....because View A (or whatever you set) IS the current view.
    Wednesday, August 30, 2017 9:04 PM

  • Hi Thank you for the answer, I can't seem to find This:

    4. Edit the page by using Site Action. ( if I go to site settings -> site actions, that option is not there)

    5. Click on the Modify Shared Web Part link of TestList . Now select the View A from selected dropdown.

    Thank you

    Tuesday, August 27, 2019 2:52 PM