Check if user is in a group in JavaScript

Useful if you want to show/hide buttons or html/controls on a page layout or in masterpage. Details from

Link jquery 11 and spservices into your masterpage through script links or custom actions


function IsGroupMember(GroupName)
    var isGroupMember = false;
        operation: "GetGroupCollectionFromUser",
        userLoginName: $().SPServices.SPGetCurrentUser(),
        async: false,
        completefunc: function(xData, Status) {
            if($(xData.responseXML).find("Group[Name='" + GroupName + "']").length == 1)                
                isGroupMember = true;
    return isGroupMember;

Call function

Admin_Group = "Owners";
if (IsGroupMember(Admin_Group))


Leave a Reply

Your email address will not be published. Required fields are marked *