0

Hi All,

I have requirement to show current user group name (site level) when logged into SharePoint 2010 portal.

I used below spservice code to get current user group name,

$(document).ready(function () {

var loggedinUserGroup =””;

$().SPServices({
operation: “GetGroupCollectionFromUser”,
userLoginName: $().SPServices.SPGetCurrentUser(),
async: false,
completefunc: function (xData, Status) {
$(xData.responseXML).find(“Group”).each(function()
{
  loggedinUserGroup = $(this).attr(“Name”);

});
}
}

});

});

Current user has many groups in site collection level. (Ex: GrpA, GrpB, GtrpC and grpD)

In sub site the user was associated with only one group (Ex: GrpC)

My question is, when the user login into the site, it should pick only GrpC from sub site instead it takes the all groups from site-collection level. 

Even i used webURL param (webURL: _spPageContextInfo.webServerRelativeUrl) in the above method but the result remains the same

(Visited 210 times, 1 visits today)
Add a Comment