code: private boolean hasViewPermissionWorkaroundForNonExistantPipelineBug_4477(CaseInsensitiveString pipelineName, Username username) {
          if (!goConfigService.hasPipelineNamed(pipelineName)) {
              throw new RecordNotFoundException(Pipeline, pipelineName);
          }
  
          if (securityService.isUserAdmin(username)) {
              return true;
          }
  
          // we check if pipeline exists because this method returns true in case the group or pipeline does not exist!
          return securityService.hasViewPermissionForPipeline(username, pipelineName.toString());
      }
docs: https://github.com/gocd/gocd/issues/4477