code: public void addUserToGroup(CmsRequestContext context, String username, String groupname, boolean readRoles)
      throws CmsException {
  
          CmsDbContext dbc = m_dbContextFactory.getDbContext(context);
          try {
              CmsRole role = CmsRole.ACCOUNT_MANAGER.forOrgUnit(getParentOrganizationalUnit(username));
              checkRoleForUserModification(dbc, username, role);
              m_driverManager.addUserToGroup(
                  dbc,
                  CmsOrganizationalUnit.removeLeadingSeparator(username),
                  CmsOrganizationalUnit.removeLeadingSeparator(groupname),
                  readRoles);
          } catch (Exception e) {
              dbc.report(null, Messages.get().container(Messages.ERR_ADD_USER_GROUP_FAILED_2, username, groupname), e);
          } finally {
              dbc.clear();
          }
      }
docs: Adds a user to a group.<p>
  
  @param context the current request context
  @param username the name of the user that is to be added to the group
  @param groupname the name of the group
  @param readRoles if reading roles or groups
  
  @throws CmsException if operation was not successful