Salome HOME
"Mark as reference" and "Remove as reference" functionality is implemented.
[tools/siman.git] / Workspace / Siman-Common / src / org / splat / som / StudyRights.java
index 7a724e1d1c007328a3270985e258ecc20dd5c769..617330f8e897d2950c8aa47fdf05c0a0df143fca 100644 (file)
@@ -100,6 +100,30 @@ public class StudyRights {
        }
       return ServiceLocatorImpl.getInstance().getStudyService().isStaffedBy(_operand, _user);
     }
+    
+    /**
+     * Can the given study be marked as reference or not.
+     * @return true/false.
+     */
+    public boolean canMarkStudyAsReference() {
+       
+       if (_operand.getProgressState() == ProgressState.APPROVED /*&& "knowledgineer".equals(_user.getRole().getName())*/) {
+               return true;
+       }
+       return false;
+    }
+    
+    /**
+     * Can the given study be unmarked as reference or not.
+     * @return true/false.
+     */
+    public boolean canRemoveStudyAsReference() {
+       
+       if (_operand.getProgressState() == ProgressState.TEMPLATE /*&& "knowledgineer".equals(_user.getRole().getName())*/) {
+               return true;
+       }
+       return false;
+    }
 
 //  ==============================================================================================================================
 //  Getter