SharePoint Blogs / SharePoint University
SharePoint Blogs and SharePoint University - all in one place!
Need SharePoint Training? Attend a SharePoint Bootcamp!

Please delete cookies related to sharepointblogs.com and sharepointu.com to resolve login issues!

How to restrict public access to sharepoint list views using filters

In sharepoint you can either create a personal or a public view on a document libraries, lists etc. You may come across situations where you need only a few individuals to see a particular view.

Lets take an example

 Your have a custom list containing software contract information like customer, license type, product, contract date,contract currency, contract amount etc. You are required to allow everyone in the sales department to see this list however the contract amount should be visible only to few management executives. You may create 2 public views, one that has the contract amount and the other that does not. The next step would be to provide read-access to the list to all the people in the sales department.

In sharepoint, if you give read access to a list or library, the person will also have read access to all public views. which means, by default everyone is able to see both the views, one with the contract amount and the one without. Not being able to control access on views seems to be a design flaw/gap in sharepoint. I hope Microsoft will address this in the next release or a service pack. Until that time, here is a workaround that may work in some of the cases

On the list where you want to restrict access to views to a few individual:

  • Create a column called "Restricted users".
  • Column Type = Person or Group
  • Allow Multiple Selections =Yes
  • Allow Selection of = People Only
  • Choose From = All Users (This is the list of Users from your Active Directory(
  • Show Field= Name ( Choose this from the drop down)

Lets say John Smith and Jane Smith are 2 executives who need to see the list views with the contract amount

Open up the list in data sheet view.  [List Name]>>Actions>> Edit In Datasheet

Scroll to the column called "Restricted Users"

Under the column, in the first cell type John Smith;Jane Smith  ( These 2 names should be in AD exactly as spelled, if not find the correct spelling)

Copy this cell to the rest of the cells under the "restricted users" column and save.

Create a view for this contract list, call it "Contract-Restricted"  or an appropriate name. This view should be created as a public view.

In the filter section where it says "show the items when"

  • Choose "Restricted Users" from the dropdown list
  • Condition =Is equal to
  • In the text box type [Me]

When sales people login to the site and selects the list, they will see both the views but when they choose the "Contract-Restricted" view, they will not see any results because of the filter.

The filter essentially looks at the current user logged in sharepoint, if it is John Smith or Jane Smith, the filter condition is met and it returns the result in the "contract-restricted" view otherwise the view will not return any result.

 

 


Posted 10-16-2007 2:28 PM by sam

Comments

Mark Miller wrote re: How to restrict public access to sharepoint list views using filters
on 10-16-2007 4:29 PM

Samdup,

Very nice post. There have been several instances in the past week where this solution would have come in handy. I hope you don't mind if I point to your post and then create a videocast demo.

Regards,

Mark

EndUserSharePoint.com

Restrict public access to sharepoint list views using filters : End User SharePoint wrote Restrict public access to sharepoint list views using filters : End User SharePoint
on 10-16-2007 4:36 PM

Pingback from  Restrict public access to sharepoint list views using filters  : End User SharePoint

sam wrote re: How to restrict public access to sharepoint list views using filters
on 10-16-2007 8:00 PM

Mark,

I am glad that you find this post helpful.Please feel free to use it as you see fit.

Regards,

Samdup

Links (10/16/2007) « Steve Pietrek’s SharePoint Stuff wrote Links (10/16/2007) « Steve Pietrek’s SharePoint Stuff
on 10-16-2007 8:08 PM

Pingback from  Links (10/16/2007) « Steve Pietrek’s SharePoint Stuff

Pirooz wrote re: How to restrict public access to sharepoint list views using filters
on 10-17-2007 9:16 AM

I've actually tried to do this several times.  I had a quick comment though.  What would stop the person from creating a personal view without the filter?

sam wrote re: How to restrict public access to sharepoint list views using filters
on 10-17-2007 10:13 AM

In my above example, there are 2 types of people, sales and management executives. Sales people have read-only access to the site. People who have read-only access to the list  cannot create personal or public views on the list. They do not see the following options in the views drop down list

Modify this view

Create view

Sean Dempsey wrote re: How to restrict public access to sharepoint list views using filters
on 10-27-2007 9:12 AM

I assume this is just for 2007, and that such a workaround is not possible on 2003?

sam wrote re: How to restrict public access to sharepoint list views using filters
on 10-30-2007 9:46 AM

I tried this on wss 3.0/ Moss 2007. Not sure if it will work on 2003

John wrote re: How to restrict public access to sharepoint list views using filters
on 11-02-2007 1:21 PM

I notice you allow selection of only people, in the column you create. I am trying to make this technique work with groups. Unfortunately, with a privileged group specified in the column, filtering by using "equal to [Me]" obviously does not work. "Contains [Me]" would seem a logical choice, but is not allowed for this type of column.

Is there a way to filter based on membership in a group, as would be so intuitive? The people who need access to the view, in this case, are too numerous to manage practically as a list, as described above.

Christian wrote re: How to restrict public access to sharepoint list views using filters
on 11-05-2007 5:37 AM

Is there a way to access subfields of my profile for the filter like:

"equal to [Me].[Country]"

Sowmya wrote re: How to restrict public access to sharepoint list views using filters
on 11-08-2007 9:59 PM

Hi,

I followed the steps given by you but am unable to edit the People or Group  created column in the Datasheet.

Please let me knoe is there any other method we can edit the value for the "Rerstricted Users" column.

Thanks

Santosh wrote re: How to restrict public access to sharepoint list views using filters
on 11-08-2007 10:10 PM

Hi I am a beginner in MOSS, Its a helpful post for my current requirement but when I tried using this I am not able to see the RestrictedUser column in Datasheet. is there any other permission I need to give.

sam wrote re: How to restrict public access to sharepoint list views using filters
on 11-11-2007 6:51 PM

This is response to John's situation where you need to enter a group name instead of selecting individual users. Group Names will not work because the view will try to match the name of the current user ( from the profile) to the filter condition and it will not work.

I have actually run into a very similar situation where we needed a huge group of people to view the list items but did not want to assign user names but instead use group names. I was able to solve the problem using workflows on a cloned lists using sharepoint designer 2007.  This solution has actually worked nicely for us.

sam wrote re: How to restrict public access to sharepoint list views using filters
on 11-11-2007 6:58 PM

You should be able to edit the restricted users column even in datasheet view.  I have done this without any problems.  What does the error say?

Try this:

In your AD list, find 2 user names eg: User1 and User2

Open the list in datasheet view,  on one of the records

go the restrictedusers column. In this row enter User1;User2

The person editing the list must have  atleast a contributor role/ role to edit the list.

Did you set the properties of restrictedusers column like i mentioned below?

Column Type = Person or Group

Allow Multiple Selections =Yes

Allow Selection of = People Only

Choose From = All Users (This is the list of Users from your Active Directory(

Show Field= Name ( Choose this from the drop down)

John Smith;Jane Smith  

John wrote re: How to restrict public access to sharepoint list views using filters
on 11-12-2007 5:21 PM

Thanks, Sam! I appreciate the response. I have access to SharePoint Designer and will give that a shot.

Ricardo Amado wrote re: How to restrict public access to sharepoint list views using filters
on 11-12-2007 5:56 PM

Nice post,

Can u me more specific on John's problem...

I'm using Sharepoint Designer for a while and can't imagine a solution for filtering by user Groups... :-)

Can u help here?

Thanks

sam wrote re: How to restrict public access to sharepoint list views using filters
on 11-12-2007 9:43 PM

John/Ricardo

I did not use views for the sharepoint designer workflow situation.

The trick was, i created a new list that matches the first list but took out the column from the second list that was supposed to be restricted.

Lets say the first list is called "Assignments". You will need to save this list as a template, including the contents. You may call it assignmenttemplate.

Now create a list based on AssignmentTemplate and call it AssignmentPublic. You may now remove some of the columns from AssignmentPublic that you do not want other people to see.

The idea of having an Assignment list and an AssignmentPublic list is, whenever an item is created in the assignment list , a workflow will create a new item in the assignmentpublic list. Whenver an item in the Assignment list is updated, the corresponding item in the AssigmentPublic will be updated. You have basically created a clone of the AssignmentList but removed some of the columns from the second list.

In the public list, you can now give permission to the groups via list settings>> manage permissions and then add the group as "Reader". In the Assignment list, remove all the users from accessing the list except for people who needs to add or update records.

If you need  details on how to do the workflow, let me know and I will post is as a blog item.

Jean wrote re: How to restrict public access to sharepoint list views using filters
on 11-15-2007 5:00 PM

In creating a Document Library, default cells are Reader only (such as Modified Date and Modified by) how can I bypass this.  I copy/paste docs from one WS to another WS and it always gives the current date and my name.

Mike wrote re: How to restrict public access to sharepoint list views using filters
on 11-18-2007 11:52 PM

Hi Sam

I think your way will work best for my situation.

Would you mind posting the workflow process to get the tasks to update on the second list?

Much appreciated!!

Jacky wrote re: How to restrict public access to sharepoint list views using filters
on 11-21-2007 4:37 AM

Hi, How to get the current user's group for filtering? Thanks!

mkn wrote re: How to restrict public access to sharepoint list views using filters
on 11-28-2007 11:35 AM

that was good but i have another sugestion you can make a folder in that liberary and give con or read permission to the folder and delete the user permission from liberary then make the views and make one of them defult then give read permission to your managers in the library so everyone would see the folder and go in it but they cant change the view only people that have a permission on the library can chane the view (would be your managers)

mkn.joo@gmail.com

Andy wrote re: How to restrict public access to sharepoint list views using filters
on 12-10-2007 10:22 PM

Hi, This is a great solution for resticting view, however i was wondering if this is possible for when your imputing data into the a list, if possible, restict the number of fields a certain user can see.

I.e.

Have a requester only see 1/2 the fields and fill them out. Then a workflow starts and an approver is tasked to see the form, but this time, let the approver see the whole form, so he/she can fill out the whole form then approve it and start another workflow to an even higher approver.

sorry if that didn't make sense to anyone..

sam wrote re: How to restrict public access to sharepoint list views using filters
on 12-12-2007 2:46 PM

Andy,

It is possible to change the "new" or "edit" forms of a list by creating a custom list form using sharepoint designer 2007.

If you have MOSS 2007 then you should use infopath forms services to do such things.

Artur wrote re: How to restrict public access to sharepoint list views using filters
on 12-21-2007 7:02 AM

Hellou,

I was willing to do same thing only for "Content Query Web part"

There is a Custom Calendar content type and i added extra column Users and Groups called workers (multivalued).

the idea is to create webpart on main page where loged in user could see for starters ONLY his or her planed activityes.

i added "Additional Filter" in "Content Query Tool Part " where worker is equal to [Me] ([Me] was typed in manualy) and error "There is a problem with the query that this Web Part is issuing. Check the configuration of this Web Part and try again" apeared.

when i changed worker column from multiple to only one value everything worked fine. but that is not what i m interested in. i need to have ability to enter an event in calendar for a group of people. sou that calendar is keped cleeen and still add data ar in the same place.

Meybe someone could help me?

Thankyou!

Charlie E. wrote re: How to restrict public access to sharepoint list views using filters
on 01-20-2008 1:03 PM

Hi Sam:

This solution works very well for my Sales Tracking page but instead of restricting some users, I reveresed it and have "Permitted Users", since that group is much smaller.

The problem I'm still having is getting Designer to add the Permitted names from an AD (picker) to that field whenever a new record is created and still have the added names allow filtering by [me]. What am I missing?

SharePoint: Restricting views by user « … no, just a large room wrote SharePoint: Restricting views by user « … no, just a large room
on 01-30-2008 10:08 PM

Pingback from  SharePoint: Restricting views by user « … no, just a large room

Bob wrote re: How to restrict public access to sharepoint list views using filters
on 02-06-2008 8:52 AM

Sam,

Does restricting the user's view really restrict the user from the file?

In other words, if the admin user shared/emailed a URL/File that was NOT in the user's view, would the user still be able to go directly to the URL/File?

This would be security by obfuscation/hiding (as opposed to setting actual access permissions), and therefore truely not secure.

Thanks,

Bob

sam wrote re: How to restrict public access to sharepoint list views using filters
on 02-15-2008 11:30 AM

Bob,

The user can go to the file directly but they will not see any data because of the filter.

Charlie Epes wrote re: How to restrict public access to sharepoint list views using filters
on 02-21-2008 10:30 AM

Sam:

On November 7, you said:  "If you need details on how to do the workflow, let me know and I will post is as a blog item".

Will you post this workflow for us?

Thanks

Charlie

Chance wrote re: How to restrict public access to sharepoint list views using filters
on 02-27-2008 3:04 AM

Just to echo cepes,

any plans to post the workflow ?

thanks for a cracking blog so far

Mike S. wrote re: How to restrict public access to sharepoint list views using filters
on 03-05-2008 9:28 AM

I used this and the filter works however if the user selects to "Alert ME" the alert content shows all the data including the filtered columns.  Any way around this?

John wrote re: How to restrict public access to sharepoint list views using filters
on 04-15-2008 5:15 AM

Great workaround, but I had a quick question.  We have a list that has a fairly large amount of people accessing it and we want to restrict certain users so that they can only see select items in that list whilst everyone else can see the entire list.  Any ideas on the best way to get that working?

Patrick wrote re: How to restrict public access to sharepoint list views using filters
on 04-16-2008 5:56 PM

This solution would work well for a static list.  However, it requires populating a certain column in every row.  If a row is added and the cell is left blank, then the row will be invisible to the authorized users.  Every time another person is added to the authorized list, you must update this column for every row.

Is there any way for different users to have different views without relying on someone correctly entering data into a column every time they add a row?

Richard wrote re: How to restrict public access to sharepoint list views using filters
on 04-29-2008 7:49 AM

Any ideas on a similar work around in 2003

Bobby wrote re: How to restrict public access to sharepoint list views using filters
on 06-03-2008 8:04 AM

Hi Sam,

thanks for the great post! I would like to ask if  the restriction of the data that users see applies also  to the data they can export to spreadsheet.

Can you suggest of a way - other that explicitly give permissions-to filter data users can see and manipulate in any way?

thanks

Glenn Laugesen wrote re: How to restrict public access to sharepoint list views using filters
on 06-24-2008 5:02 PM

There is a problem with this approach in that a user may view the restricted files by simply performing a search. The search query will return the documents and the user will be able to view them as there are no actual permissions set which explicitly deny access.

As Bob said, this method is only security by obfuscation, not by restricting permissions, which is what would be required for proper access restriction to be enforced.

Regards,

Glenn.

Rahul Gulati wrote re: How to restrict public access to sharepoint list views using filters
on 07-24-2008 3:16 PM

Hi Sam,

Really nice post.Actually I have problem and it's realted with Public views.

I want to restrict user from modifying my view that I created as public.Please suggest some solution for the same.

Thanks in advance!

Andrei wrote re: How to restrict public access to sharepoint list views using filters
on 07-29-2008 10:34 AM

Glenn, you can try to eliminate the risk of appearing list items in the search results by setting

"Allow items from this list to appear in search results?" list's property  to "No"

This setting can be found under List Advanced Settings

JohnnieG wrote re: How to restrict public access to sharepoint list views using filters
on 07-31-2008 6:31 AM

I'm not that familiar with them, but it sounds like a Data View Web Part might be the right solution here.

Again, you need sharepoint designer for this, but it will give you ultimate control over which columns are visible.

Cheers

J

MossBoy wrote re: How to restrict public access to sharepoint list views using filters
on 08-12-2008 10:15 AM

Hi Sam,

I have View1,view2,View3 and i Have UserGroup1 And UserGroup2,UserGroup3 ..

Do u have any Solution for UserGroup1 Can Only See View1 ,Usergroup2 can see View2?

Thanks in advance

meenu wrote re: How to restrict public access to sharepoint list views using filters
on 08-20-2008 4:37 AM

U have not come to a conclusion after this whole long dicussion.........

Terry wrote re: How to restrict public access to sharepoint list views using filters
on 09-04-2008 5:41 PM

Whenever I change to the datasheet view I can no longer see the 'Restricted Users' column.  I'm pretty much dead in the water at that point.  Anyone got suggestions?

Tasha wrote re: How to restrict public access to sharepoint list views using filters
on 09-16-2008 11:28 AM

Hi Terry --

I had the same experience. The only way I could get it to show up was to change the 'Restricted Users' field to NOT allow multiple selections... then it appeared in data sheet view.

Tasha

Simon wrote re: How to restrict public access to sharepoint list views using filters
on 09-25-2008 5:55 AM

How do you restrict permissions to sub-folders under a document library? Or do all folders under the library have to follow the same access permissions?

Thanks!

ova ceren wrote re: How to restrict public access to sharepoint list views using filters
on 10-08-2008 2:03 AM

this is a brilliant solution,  but i discovered something.

If your site language is different than English you have to use the word in that language which stands for "me"

for example, in a site with  turkish language you have to use [Ben]

Thanks again!

Ria Mir wrote re: How to restrict public access to sharepoint list views using filters
on 11-05-2008 12:26 AM

can i use a default value for this column? "Restricted Users"? how to set it?

Akshaya.P wrote re: How to restrict public access to sharepoint list views using filters
on 12-11-2008 1:51 AM

hi,

can u plz explain abt column level permission in brief.

1)i have a list "poster  approval list"

2)the employess has to attach a poster with name,mode.

3)i have 2 more column Approval status and comments

4)these 2 columns are only filled by the managers,these should be invisble to employees

plz help me .....i have sahrepoint disinger

i dont have visual studio ......

plzzzzzzzzz

Mark wrote re: How to restrict public access to sharepoint list views using filters
on 12-28-2008 10:28 PM

Hi

I did exactly as what is said over here. When i log in as sales people i can see both views and when i choose Contract-Restricted view i cannot see any thing which is fine.

Now when i log in as Jane Smith or John Smith i should see all list items on Contract-Restricted view.But i cannot? Why

brad wrote re: How to restrict public access to sharepoint list views using filters
on 02-10-2009 11:53 PM

great post!  Enlightened me

Joanna wrote re: How to restrict public access to sharepoint list views using filters
on 03-05-2009 8:14 AM

Your information is very helfpul. However, is there a way to prevent the user from changing the settings of the view (so that they can add in columns that we would like to hide)?

Iammontoya wrote re: How to restrict public access to sharepoint list views using filters
on 05-20-2009 3:13 PM

Hi Sam, is there any chance you could share that workflow that you mention above? That would be very helpful!

Great post and responses, btw.

howartthou wrote re: How to restrict public access to sharepoint list views using filters
on 06-06-2009 4:26 AM

Hi All

Thought I would share a way I discovered to solve the Group problem.

First I created a new list for each group and assigned the appropriate group to each list.

Then I created a web part page and then added to a web part all of the lists.

Then for each list I set the "Target Audiences" property in the "Advanced" section to the same group already assigned to the list. I believe this is required because web parts have their own security...so yes you have to assign the group twice, once when you create the list and again when you add the list to the web part.

The end result is a web page that looks like it has one list on it based on your authenticated user when if fact it has multiple lists that are hidden if the authenticated user is not in the group assigned to the list.

This solution may not suit all scenarios but suite where you need one page with one list but you don't want groups to see each others lists / rows.....

:)

Marius wrote re: How to restrict public access to sharepoint list views using filters
on 06-30-2009 4:45 PM

Are there more general settings that can be used accross the board to restrict users for viewing only some items in a list?

I think your solution is good, will test tonight, but here is my situation:

I have to add about 100 people as users to a list, but they can only see those items in the list where their name is copied.

How should I set this up?

Add a Comment

(required)  
(optional)
(required)  
Remember Me?
Need SharePoint Training? Attend a SharePoint Bootcamp!
Posts (c) their respective authors. Everything else (c) 2009 SharePoint Experts, Inc.