Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have one list

    Title           Availability        Department
-----------------------------------------------------
    Microscope      Yes                 Biology
    Buret           No                  Chemistry
    Glass Tubes     Yes                 Biology

When any person belongs to Biology login to my site, I want to hide Chemistry related rows. Same case with Chemistry people also. How Can I set these permissions for a list. Is it possible way to do?

share|improve this question
    
Is 100 items considered large in this case? –  KLO Sep 6 '12 at 18:55
add comment

3 Answers 3

up vote 7 down vote accepted
  1. If is only about viewing, then you should probably consider Views or go for Target Audience (this is will hide items from view automatically without changing permissions - does require User Profile)
  2. If you really need permissions than try building a workflow on particularly those conditions so that everytime a new list item gets added permissions are set
share|improve this answer
    
for your first point... When we create view we can restrict the columns.. not the rows. Am I right!! –  Mihir Aug 11 '12 at 10:25
2  
You can restrict the rows by adding and audience to the list items. Then when users access the list, they'll see what they are scoped to see via the audience targeting, which can be sp groups or ad groups. –  PirateEric Aug 11 '12 at 13:44
add comment

Might not be the best option but because of limited information given by you I would suggest

You can create a custom Item level permission, and add that user to that particular group, but for this you will have to break inheritance. You can do this if Items are already there and list wont gonna get updated but if list will be updated frequently then you can have a feature receiver for adding Item, so that when a Item is added you can set its permission levels.

In both case you will have to break List Inheritance.

check this link out, might help :)

Item Level Permissions on a Custom List

Edit

Develop a Feature that will Break List Inheritance on activation, and then create a hidden bool column for your list as when "Maintenance Guy" will add a Item he will check box if item is related to chemistry, he will check box otherwise he will leave it blank.

Now make 2 permission levels one for chemistry students and one for biology, you can give permissions e.g. read list item or edit it, that's up 2 you.

Now develop a Item added Event Receiver that will check value of hidden column, if its true (then its related to chemistry students otherwise biology) then set that Item's permission as chemistry permission level if its not true then let that user have biology permission level you created earlier.

thats how I did it once, but if someone knows any better way they already tried then please share :)

share|improve this answer
    
What information you want more about this problem. I think it is sufficient. If not please tell me what you want. Then I can provide you. :) –  Mihir Aug 14 '12 at 12:09
    
what type of list it is, and who will be adding items to it, if it will be a particular user and you want to give him only specific permission then you can use Item Level permissions using a Item added feature. –  Muhammad Raja Aug 14 '12 at 12:13
    
For example.. Maintenance guy will update the list. List is generic list (custom list). When Biology department person logged in then list should only appear with Biology items. Same case with other departments. –  Mihir Aug 14 '12 at 13:45
    
I updated my answer –  Muhammad Raja Aug 14 '12 at 14:18
    
Be careful when recommending item level security. It can result in serious performance issues on large lists, especially if the unique security differs from item to item. –  Anders Rask Aug 16 '12 at 9:50
show 1 more comment

can you be more specific? like is that in a grid view? if so filtering would be possible and easy to do with a small method that check with the user and filters the results accordingly.

if you want to know about the grid view than look here: http://msdn.microsoft.com/en-us/library/ms752213.aspx and here: What is SP Grid View & How to use it?

otherwise you would need to filter the data from a stored procedure within the .cs or on the database side to only return the results for the logged in user.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.