docs: private void addGroupsForUser(final RestletUtilUser user, final Set<Group> userGroups, final Group currentGroup,
              final Set<Group> stack, final boolean inheritOnly)
      {
          if((currentGroup != null) && !stack.contains(currentGroup))
          {
              stack.add(currentGroup);
              
              if(currentGroup.getMemberUsers().contains(user))
              {
                  userGroups.add(currentGroup);
                  
                  // Add the ancestor groups as well
                  boolean inherit = !inheritOnly || currentGroup.isInheritingRoles();
                  
                  if(inherit)
                  {
                      for(final Group group : stack)
                      {
                          userGroups.add(group);
                          inherit = !inheritOnly || group.isInheritingRoles();
                      }
                  }
              }
              
              for(final Group group : currentGroup.getMemberGroups())
              {
                  this.addGroupsForUser(user, userGroups, group, stack, inheritOnly);
              }
          }
      }