code: private CmsPrincipal getPrincipal(CmsObject cms, DialogType type, CmsUUID id) throws CmsException {
  
          if (type.equals(DialogType.Group)) {
              return cms.readGroup(id);
          }
          if (type.equals(DialogType.User)) {
              return cms.readUser(id);
          }
          return null;
      }
docs: Get principal from id.<p>
  
  @param cms CmsObject
  @param type user or group
  @param id id of principal
  @return Principal
  @throws CmsException exception