0

I have a custom list with several custom SharePoint 2010 forms, and each form is tied to a different step in the approval process. I need to be able to set unique permissions on each individual form within this list, and so far the only way I have figured out how to do this is to move the form to Site Pages, create permissions there, and move it back.

This is great, but then it changes all of the unique IDs of each field and I have to redo all of the IDs on my thousand lines of Javascript/jQuery.

Does anyone know of another way to set unique permissions on each form either out of the box or in SP Designer?

0

So I did a little programming work-around that solves all of my problems. It may not be the "best" or the "right" way to do it, but it easily provides unique permissions on each form in one list without having to move the form around.

$(document).ready(function() {
    //use this to get the current user
    thisUserAccount = $().SPServices.SPGetCurrentUser({
        fieldName: "Name",
        debug: false
    });

    //initiate a new array and a new counter
    groupArray = new Array(); 
    groupCounter = 0;

    //get all of the groups the current user is a part of
    $().SPServices({ 
      operation: "GetGroupCollectionFromUser", 
            userLoginName: thisUserAccount,
            async: false, 
            completefunc: function(xData, Status){
                $(xData.responseXML).find("Group").each(function(){ 
                    //if the group contains "Approver" and "LV1" then add it to the counter
                    if($(this).attr("Name").indexOf("Approver")>-1 && $(this).attr("Name").indexOf("LV1")>-1){
                        groupCounter++;
                    }
                });
            }
    }); 
    //if the groupCounter is greater than zero, meaning there is a group added to the list
    //that meets the requirements stated above, then display the form
    if(groupCounter > 0){
        $('#bodyWrapper').show(); //displays entire form
    }
    //if the user is not in the required groups, show the error message and do not display the form
    else {
        $('#userError').show(); //shows custom error message
        $("#s4-ribbonrow").hide(); //hides edit ribbon
    }
}); //end document ready
  • Not sure if I would call hiding stuff with jQuery a mean of doing security trimming. The user can still find and fill in the forms with some digging? – Robert Lindgren May 13 '15 at 15:18
  • Well, they can still find it, but for my purposes I am not even a little concerned about them doing that. It's a secure site with limited access, and 99% of the people who use it are not even remotely tech savvy :) This is definitely not a solution to an actual need for security, but it works for me for an already secure site. I imagine it will work for someone else, too. – Caola May 25 '15 at 0:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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