]> SALOME platform Git repositories - tools/siman.git/commitdiff
Salome HOME
MarkAsReference and RemoveAsReference operations are improved.
authormka <mka@opencascade.com>
Wed, 17 Apr 2013 11:53:21 +0000 (11:53 +0000)
committermka <mka@opencascade.com>
Wed, 17 Apr 2013 11:53:21 +0000 (11:53 +0000)
Workspace/Siman-Common/src/org/splat/som/StudyRights.java

index 58191aa5daf84255cfc5cf60cbbee332083087c2..6b53d4fe36aa337e7f8034479499071b1e014f98 100644 (file)
@@ -168,7 +168,8 @@ public class StudyRights {
         * @return true/false.
         */
        public boolean canMarkStudyAsReference() {
-               return (_operand.getProgressState() == ProgressState.APPROVED /* && "knowledgineer".equals(_user.getRole().getName()) */);
+               int roleIndex = _user.getRole().getName().indexOf("knowledgineer");
+               return (_operand.getProgressState() == ProgressState.APPROVED  && (roleIndex > -1));
        }
 
        /**
@@ -177,7 +178,8 @@ public class StudyRights {
         * @return true/false.
         */
        public boolean canRemoveStudyAsReference() {
-               return (_operand.getProgressState() == ProgressState.TEMPLATE /* && "knowledgineer".equals(_user.getRole().getName()) */);
+               int roleIndex = _user.getRole().getName().indexOf("knowledgineer");
+               return (_operand.getProgressState() == ProgressState.TEMPLATE  && (roleIndex > -1));
        }
 
        // ==========================================================================