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
Clark:
Those are ancient versions of both jQuery and SPServices. If you are using those, I *highly* suggest upgrading.
M.