This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository wao. See http://git.codelutin.com/wao.git commit cfb619c2952bf49ad263f19f77981e1264d65929 Author: Brendan Le Ny <bleny@codelutin.com> Date: Tue Jan 27 17:04:45 2015 +0100 Si une ligne est affectée à Ifremer, on autorise tous les labos à créer un contact scléro (fixes #6565) --- .../main/java/fr/ifremer/wao/services/AuthenticatedWaoUser.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/wao-services/src/main/java/fr/ifremer/wao/services/AuthenticatedWaoUser.java b/wao-services/src/main/java/fr/ifremer/wao/services/AuthenticatedWaoUser.java index 0ca8bdb..2492aa3 100644 --- a/wao-services/src/main/java/fr/ifremer/wao/services/AuthenticatedWaoUser.java +++ b/wao-services/src/main/java/fr/ifremer/wao/services/AuthenticatedWaoUser.java @@ -23,6 +23,7 @@ package fr.ifremer.wao.services; import com.google.common.base.Objects; import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableSet; import fr.ifremer.wao.entity.Company; import fr.ifremer.wao.entity.Contact; import fr.ifremer.wao.entity.News; @@ -229,7 +230,11 @@ public class AuthenticatedWaoUser implements Serializable{ * dont le topiaId est en paramètre. */ public boolean isAuthorizedToCreateContact(String sampleRowOrganisationId) { - return isAuthorizedToCreateContact() && waoUser.getOrganisation().getTopiaId().equals(sampleRowOrganisationId); + ImmutableSet<String> organisationIds = ImmutableSet.of( + waoUser.getOrganisation().getTopiaId(), + waoUser.getOrganisation().getCompany().getTopiaId()); + boolean waoUserOrganisationIsOk = organisationIds.contains(sampleRowOrganisationId); + return isAuthorizedToCreateContact() && waoUserOrganisationIsOk; } public boolean isAuthorizedToUpdateContact() { -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.