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 a list "Projects". Each ListItem stores which users are working on that project.

I have 2 groups within SP - "ProjectManagers" and "ProjectMembers".

Now I want to customize AllItems.aspx page, so if user is in Group "ProjectMembers", he can see only those projects, that he's participated in. If user is in ProjectManagers Group, no customization needed.

How can I achieve this ?

share|improve this question

1 Answer 1

up vote 3 down vote accepted

Are there two fields for the list item that are people picker fields. I am assuming thats what you meant by stores which users are working on the project. If so you can modify the view by adding filters. Open the view and select modify. Go to the filter section and choose ProjectManager = [Me] or ProjectMember = [Me].

Is there any reason why you are not using the people picker lookup field? That will make it much easier to accomplish what you are trying to do here. Otherwise you will need to convert the list view via SharePoint designer or write a custom view via Visual Studio. That view will need code that can look at the groups web service to determine the user. In something like this I would essentially have a people picker field that allows for multiple users and associate that field with the ProjectMember SharePoint group. Then you can just do what I stated above

share|improve this answer
    
Thanks for quick response. I have many fields in my list, one of them is "Members" field, which is comma separated string of user id's who are working on the project. So I need to check if current user is in group "ProjectMember" and if so I need to check if current user is working on the project. –  Michael May 5 '12 at 16:49
    
Is there any reason why you are not using the people picker lookup field? That will make it much easier to accomplish what you are trying to do here. Otherwise you will need to convert the list view via SharePoint designer or write a custom view via Visual Studio. That view will need code that can look at the groups web service to determine the user. In something like this I would essentially have a people picker field that allows for multiple users and associate that field with the ProjectMember SharePoint group. Then you can just do what I stated above. –  Cory May 5 '12 at 16:58
    
I think you're right! Thanks, how can I mark your comment as answer ? –  Michael May 5 '12 at 17:06
    
just added it to my original response. thanks –  Cory May 5 '12 at 17:19
    
+1 for for detailed explanations –  Michael May 5 '12 at 18:30

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.