code: protected CmsObject initCmsObject(CmsObject adminCms, CmsContextInfo contextInfo)
      throws CmsRoleViolationException, CmsException {
  
          String userName = contextInfo.getUserName();
  
          if ((adminCms == null) || !m_roleManager.hasRole(adminCms, CmsRole.ROOT_ADMIN)) {
              if (!userName.endsWith(getDefaultUsers().getUserGuest())
                  && !userName.endsWith(getDefaultUsers().getUserExport())) {
  
                  // if no admin object is provided, only "Guest" or "Export" user can be generated
                  CmsMessageContainer message = Messages.get().container(
                      Messages.ERR_INVALID_INIT_USER_2,
                      userName,
                      ((adminCms != null) ? (adminCms.getRequestContext().getCurrentUser().getName()) : ""));
                  if (LOG.isWarnEnabled()) {
                      LOG.warn(message.key());
                  }
                  throw new CmsRoleViolationException(message);
              }
          }
  
          return initCmsObject(contextInfo);
      }
docs: Returns an initialized CmsObject with the user and context initialized as provided.<p>
  
  Note: Only if the provided <code>adminCms</code> CmsObject has admin permissions,
  this method allows the creation a CmsObject for any existing user. Otherwise
  only the default users 'Guest' and 'Export' can initialized with
  this method, all other user names will throw an Exception.<p>
  
  @param adminCms must either be initialized with "Admin" permissions, or null
  @param contextInfo the context info to create a CmsObject for
  
  @return an initialized CmsObject with the given users permissions
  
  @throws CmsException if an invalid user name was provided
  @throws CmsRoleViolationException if the current user does not have the role permissions to create a context for the requested user
  
  @see org.opencms.db.CmsDefaultUsers#getUserGuest()
  @see org.opencms.db.CmsDefaultUsers#getUserExport()
  @see OpenCms#initCmsObject(CmsObject)
  @see OpenCms#initCmsObject(CmsObject, CmsContextInfo)
  @see OpenCms#initCmsObject(String)