Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm pretty new to Sharepoint and what I would like to do is create a huge master list of all our employees and then make different "views" on that person depending on the persons group

For example:

A new employee might have

  • Salary info
  • Security info
  • Personnel info
  • Contract info

I would like to have all that in one row (per employee) but then when someone from the hr group logs in they can only see Personnel and Salary or something like that.

If that is not an option is there a way to link tables across different lists?

share|improve this question
    
WOAMQ: Work on answering my question and i will –  Crash893 Jan 20 '11 at 13:30
1  
I'm sorry but Greg's right, you're being selfish and mod-flagging his comment does nothing but draw mod attention to this. –  Chopper3 Jan 20 '11 at 16:46
    
how/where do you set those permissions? Where do you store those pages? In a restricted doc library? –  user61310 Feb 9 '11 at 4:24
add comment

4 Answers

up vote 2 down vote accepted

Easy. 1 list. Several different views for that list, based on metadata - department, building, whatever. You can show different cols in each view. For instance...for HR, you'd show the salary col as well as the name col. For regular people, another view that does NOT show the salary.

Now we make a few web part pages. On each web part page, put a web part that shows our list. But it only shows one view of that list, with no real way to get to any others.

Now we restrict permissions for each of those web part pages to only the group(s) that you want to see it.

So - web part pages that show different views of the same list, and permission restrictions on those web part pages.

share|improve this answer
add comment

Solution with no asp code:

You will need two javascript libraries:
- Jquery
- SPServices - http://spservices.codeplex.com/

In sharepoint, create a non-public library called "Jquery libraries" and upload your jquery and SPServices to it.

In sharepoint designer, create a copy of AllItems.aspx.

In sharepoint designer, edit the file AllItems.aspx. Clear all the code and insert this javascript code.

        <script language="javascript" type="text/javascript" src="PATH-TO-YOUR-JQUERY-FILE"></script>
<script language="javascript" type="text/javascript" src="PATH-TO-YOUR-SPSERVICES-FILE"></script>

<script type="text/javascript">
$(document).ready(function() {
    //Get current username
    userName = $().SPServices.SPGetCurrentUser({
        fieldName: "Name",
        debug: false
    });

    //get user's group
    $().SPServices({
        operation: "GetGroupCollectionFromUser",
        userLoginName: userName,
        async: false,
        completefunc: function(xData, status){

            $(xData.responseXML).find("Group").each(function(){
                if(status == "success"){
                    var nomeGrupo = $(this).attr('Name');
                    //if user is in group 1 redirect to page 1. If user is in group 2 redirect to page 2 etc...
                    if(nomeGrupo=="Grupo sergio"){
                             window.location.replace("PATH-TO-PAGE-1/SomeItems.aspx");
                    }else{
                        window.location.replace("/PATH-TO-PAGE-2/ViewAll.aspx");
                    }

                }else{
                    alert("Falha na comunicação com o Sharepoint");
                }
            });
        }
    });
});
</script>

This code will redirect the user to other pages that will contain customised web-parts-view.

In sharepoint design, rename the AllItems.aspx to SomeItems.aspx (for example).

You can create multiples copys of this file and follow the next step to customise it.

Edit this file and delete the main webpart located at PlaceHolderMain.(Tip: u can click and delete if u are in split view(code an design) in sharepoint designer).

Then, you can insert a custom web part view for your list. In this custom view, you can filter data or not display some colums.

share|improve this answer
    
I'll try this out –  Crash893 Nov 29 '12 at 22:20
add comment

I am totally agree with SharePointAdminGuy. However, as a developer of SharePoint Column permission, I do not believe you can hide specific column from individuals.

share|improve this answer
add comment

Hi I managed to hide a field programmatically see below. The Approve field is now hidden in the edit screen of the list

SPField Appprove = bdcList.Fields.GetField("Approved");
                        Appprove.ShowInEditForm = false;
                        Appprove.ShowInDisplayForm = true;
                        Appprove.ShowInNewForm = false;
                        Appprove.Update();
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.