code: function getUserAuthorizedGroups(user, operation) {
    var userGroups = getUserGroups(user);
    var groups = [];
  
    for (var groupId in userGroups) {
      if (userGroups[groupId].indexOf(operation) >= 0)
        groups.push(groupId);
    }
  
    return groups;
  }
docs: Gets the list of groups of a user, with authorization on a certain operation.
  
  All user groups with authorization on the operation are returned.
  
  @method getUserAuthorizedGroups
  @private
  @param {Object} user The user
  @param {String} operation The operation (get, update or delete)
  @return {Array} The list of user groups which have authorization on the given operation