public boolean canViewAndEditTemplate(CaseInsensitiveString username, List<Role> roles) {
        for (PipelineTemplateConfig templateConfig : this) {
            if (canUserEditTemplate(templateConfig, username, roles)) {
                return true;
            }
        }
        return false;
    }
@Test
    public void shouldReturnFalseIfUserCannotViewAndEditAtLeastOneTemplate() throws Exception {
        CaseInsensitiveString templateAdmin = new CaseInsensitiveString("template-admin");
        CaseInsensitiveString nonTemplateAdmin = new CaseInsensitiveString("some-random-user");
        TemplatesConfig templates = configForUserWhoCanViewATemplate();
        templates.add(PipelineTemplateConfigMother.createTemplate("template200", new Authorization(new AdminsConfig(new AdminUser(templateAdmin))), StageConfigMother.manualStage("stage-name")));

        assertThat(templates.canViewAndEditTemplate(nonTemplateAdmin, null), is(false));
    }