[
https://issues.apache.org/jira/browse/SYNCOPE-866?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15313848#comment-15313848
]
ASF GitHub Bot commented on SYNCOPE-866:
----------------------------------------
Github user ilgrosso commented on a diff in the pull request:
https://github.com/apache/syncope/pull/18#discussion_r65673143
--- Diff:
core/logic/src/main/java/org/apache/syncope/core/logic/ReportTemplateLogic.java
---
@@ -84,6 +85,12 @@ public ReportTemplateTO transform(final ReportTemplate
input) {
@PreAuthorize("hasRole('" + StandardEntitlement.REPORT_TEMPLATE_CREATE
+ "')")
public ReportTemplateTO create(final String key) {
+ for (ReportTemplateTO reportTemplateTO: list()) {
--- End diff --
Take a look at
[ResourceLogic](https://github.com/apache/syncope/blob/master/core/logic/src/main/java/org/apache/syncope/core/logic/ResourceLogic.java#L121-L123)
and do accodingly.
> Check for existence of key before adding template
> -------------------------------------------------
>
> Key: SYNCOPE-866
> URL: https://issues.apache.org/jira/browse/SYNCOPE-866
> Project: Syncope
> Issue Type: Improvement
> Components: core
> Reporter: Tushar Mishra
> Fix For: 2.0.0
>
>
> The create(String key) method in the MailTemplateLogic and
> ReportTemplateLogic classes of the org.apache.syncope.core.logic package
> should check if the key being added to the MailTemplateDAO instance is
> already present. If such a key already exists, it should throw an appropriate
> exception for the same.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)