Hide/Show Edit Fields Based on SharePoint Permissions
I have been looking for a way to hide edit fields based on permission levels in SharePoint. I have done it before using conditional formatting in SharePoint Designer but sadly when you do this, it breaks the form. That is when I discovered SPServices. It is essentially a jquery library that simplifies the SharePoint web services and makes them easier to use.
Based on the following code snippet, I was able to hide the edit field based around the user’s permission level in SharePoint.
$().SPServices({
operation: "GetGroupCollectionFromUser",
userLoginName: $().SPServices.SPGetCurrentUser(),
async: false,
completefunc: function(xData, Status) {
if($(xData.responseXML).find("Group[Name='SHAREPOINTGROUP']").length == 1)
{
$("#DIVID").hide();
}
else
{
$("#DIVID").show();
}
}
});

