]> SALOME platform Git repositories - tools/siman.git/commitdiff
Salome HOME
Condition in canDemote is simplified.
authorrkv <rkv@opencascade.com>
Tue, 16 Apr 2013 16:59:17 +0000 (16:59 +0000)
committerrkv <rkv@opencascade.com>
Tue, 16 Apr 2013 16:59:17 +0000 (16:59 +0000)
Workspace/Siman-Common/src/org/splat/som/DocumentRights.java
Workspace/Siman-Common/src/org/splat/som/StudyRights.java

index 2d0399e3919206464eb0fc25f504471d10f99f97..571b419e1a34e8791a28a3cda9393ad1c1dacbb1 100644 (file)
@@ -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<Relation> use = _operand.value().getRelations(
index ac98a65ae93aec26ed1a2a5f8eec91ca00a0af74..58191aa5daf84255cfc5cf60cbbee332083087c2 100644 (file)
@@ -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;
        }