From: rkv Date: Tue, 16 Apr 2013 16:59:17 +0000 (+0000) Subject: Condition in canDemote is simplified. X-Git-Tag: Root_Delivery2_2013_04_22~26 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=67128ddfb243cd3ce6a7fd86518608b2a4789713;p=tools%2Fsiman.git Condition in canDemote is simplified. --- diff --git a/Workspace/Siman-Common/src/org/splat/som/DocumentRights.java b/Workspace/Siman-Common/src/org/splat/som/DocumentRights.java index 2d0399e..571b419 100644 --- a/Workspace/Siman-Common/src/org/splat/som/DocumentRights.java +++ b/Workspace/Siman-Common/src/org/splat/som/DocumentRights.java @@ -168,21 +168,12 @@ public class DocumentRights { User approver = _cycle.getActor(ValidationStep.APPROVAL); // May be null if not approvable ProgressState mystate = _operand.value().getProgressState(); - boolean res = (((mystate != ProgressState.inDRAFT || publisher != null - || _isauthor || _user.equals(manager)) - && (publisher == null || _user.equals(publisher)) || _user - .equals(reviewer)) - - && (mystate != ProgressState.inCHECK - - || ((approver == null || _user.equals(approver) || _user - .equals(reviewer)) - - && (approver != null || _user.equals(publisher) || (reviewer == null || _user - .equals(reviewer)) - && (reviewer != null || _user.equals(manager))))) - - && (mystate == ProgressState.inCHECK || mystate == ProgressState.inDRAFT)); + boolean res = (mystate == ProgressState.inDRAFT + && (_user.equals(publisher) || _user.equals(reviewer) + || _user.equals(manager) || (reviewer == null) + && _user.equals(approver)) || mystate == ProgressState.inCHECK + && (_user.equals(approver) || _user.equals(reviewer) || (reviewer == null) + && (_user.equals(publisher) || _user.equals(manager)))); if (res) { List use = _operand.value().getRelations( diff --git a/Workspace/Siman-Common/src/org/splat/som/StudyRights.java b/Workspace/Siman-Common/src/org/splat/som/StudyRights.java index ac98a65..58191aa 100644 --- a/Workspace/Siman-Common/src/org/splat/som/StudyRights.java +++ b/Workspace/Siman-Common/src/org/splat/som/StudyRights.java @@ -216,21 +216,12 @@ public class StudyRights { User approver = _cycle.getActor(ValidationStep.APPROVAL); // May be null if not approvable ProgressState mystate = _operand.getProgressState(); - boolean res = (((mystate != ProgressState.inDRAFT || publisher != null - || _isauthor || _user.equals(manager)) - && (publisher == null || _user.equals(publisher)) || _user - .equals(reviewer)) - - && (mystate != ProgressState.inCHECK - - || ((approver == null || _user.equals(approver) || _user - .equals(reviewer)) - - && (approver != null || _user.equals(publisher) || (reviewer == null || _user - .equals(reviewer)) - && (reviewer != null || _user.equals(manager))))) - - && (mystate == ProgressState.inCHECK || mystate == ProgressState.inDRAFT)); + boolean res = (mystate == ProgressState.inDRAFT + && (_user.equals(publisher) || _user.equals(reviewer) + || _user.equals(manager) || (reviewer == null) + && _user.equals(approver)) || mystate == ProgressState.inCHECK + && (_user.equals(approver) || _user.equals(reviewer) || (reviewer == null) + && (_user.equals(publisher) || _user.equals(manager)))); return res; }