SPServices Check Is user is in a Perticual group.
var groupname="your group name";
function IsUserInGroup(){
jQuery().SPServices({
operation: "GetGroupCollectionFromUser",
userLoginName: jQuery().SPServices.SPGetCurrentUser(),
async: false,
completefunc: function(xData, Status) {
jQuery(xData.responseXML).find("Group").each(function(){
if(jQuery(this).attr("Name") == groupname)
{
//Method to call if user is in perticualr group.
executeifOwners();
return;
}
});
}
});
}
var groupname="your group name";
function IsUserInGroup(){
jQuery().SPServices({
operation: "GetGroupCollectionFromUser",
userLoginName: jQuery().SPServices.SPGetCurrentUser(),
async: false,
completefunc: function(xData, Status) {
jQuery(xData.responseXML).find("Group").each(function(){
if(jQuery(this).attr("Name") == groupname)
{
//Method to call if user is in perticualr group.
executeifOwners();
return;
}
});
}
});
}
No comments:
Post a Comment