public boolean canViewAndEditTemplate(CaseInsensitiveString username, List<Role> roles) {
        for (PipelineTemplateConfig templateConfig : this) {
            if (canUserEditTemplate(templateConfig, username, roles)) {
                return true;
            }
        }
        return false;
    }
@Test
    public void shouldReturnTrueIfUserWithinARoleCanViewAndEditTemplates() {
        CaseInsensitiveString templateAdmin = new CaseInsensitiveString("template-admin");
        Role securityConfigRole = getSecurityConfigRole(templateAdmin);
        List<Role> roles = setupRoles(securityConfigRole);

        ArrayList<PipelineTemplateConfig> templateList = new ArrayList<>();
        templateList.add(PipelineTemplateConfigMother.createTemplate("templateName", new Authorization(new AdminsConfig(new AdminRole(securityConfigRole))), StageConfigMother.manualStage("some-random-stage")));
        TemplatesConfig templates = new TemplatesConfig(templateList.toArray(new PipelineTemplateConfig[0]));

        assertThat(templates.canViewAndEditTemplate(templateAdmin, roles), is(true));
    }