Skip to main content


isMemberOfGroup for a specific User and not the current one



  • Christof Nussbaumer

    Hi Joel

    There is no built-in function or hidden functionality to check this so far.

    The technical possibility of this new function was in discussion in our development team and needs some more investigation.
    Since these functionality is all running in client context it's needed to check if these queries would work for all users... and some more research is needed before starting an implementation.

    You can expect further updates about this topic here.


  • Matthias Walter

    Hi  Joel Grütter,

    Our investigations have shown that it would be technically possible and that it is possible to read out the group memberships of other users even as a read-only user.
    Currently this can be achieved via the following script.

    //jQuery.Deferred used to wait while it checking
    var deferrer = jQuery.Deferred();
    //Name of Group to check
    var groupName = "Group Name";
    var context = new SP.ClientContext.get_current();
    var web = context.get_web();
    //Use People or Group Field and take ID of user in it
    var user = web.get_siteUsers().getById([[UserFieldSingle.ID]]);
    var groups = user.get_groups();
             Function.createDelegate(null, loadUserGroupsSuccess),
             Function.createDelegate(null, loadUserGroupsFail)
    function loadUserGroupsSuccess() {
            var gEnumerator = groups.getEnumerator();                        
            var belongstoSpecifiedgroup = false;
            while (gEnumerator.moveNext()) {
                var currGroup = gEnumerator.get_current();
                if (currGroup.get_title().toLowerCase() == groupName.toLocaleLowerCase()) {
                    belongstoSpecifiedgroup = true;
    //Resolve deferred with value
    function loadUserGroupsFail(sender,args) {
    //reject deferred with error
    return deferrer.promise();

    In order to include it as an easy-to-use function in our expressions, I must ask you, to add this as an idea and give your vote for it.


Please sign in to leave a comment.