]> SALOME platform Git repositories - tools/siman.git/blobdiff - Workspace/Siman-Common/src/org/splat/som/StudyRights.java
Salome HOME
Publish the study functionality is improved, protect the study functionality is imple...
[tools/siman.git] / Workspace / Siman-Common / src / org / splat / som / StudyRights.java
index 617330f8e897d2950c8aa47fdf05c0a0df143fca..d90863d02263a91b0bdd81e1726cea33a3f45306 100644 (file)
@@ -63,19 +63,35 @@ public class StudyRights {
       return _author;
     }
 
-/**
- * Checks if the user has right to move the study from the Private to the Public area of the repository.
- * Only the author of the study have such right.
- * 
- * @return true if the user has right to edit the description.
- */
-    public boolean canPublish () {
-//  ----------------------------
-      if (!_author) {
+       /**
+        * Checks if the user has right to move the study from the Private to the Public area of the repository. Only the author of the study
+        * have such right.
+        * 
+        * @return true if the user has right to edit the description.
+        */
+       public boolean canPublish() {
+               // ----------------------------
+               if (_operand.getProgressState() == ProgressState.APPROVED
+                               && !_operand.isPublic()/* && "knowledgineer".equals(_user.getRole().getName()) */) {
+                       return true;
+               }
+               return false;
+       }
+
+       /**
+        * Checks if the user has right to move the study from the Public to the Private area of the repository. Only the author of the study
+        * have such right.
+        * 
+        * @return true if the user has right to edit the description.
+        */
+       public boolean canProtect() {
+               // ----------------------------
+               if (_operand.getProgressState() == ProgressState.APPROVED
+                               && _operand.isPublic()/* && "knowledgineer".equals(_user.getRole().getName()) */) {
+                       return true;
+               }
                return false;
        }
-      return (!_operand.isPublic());
-    }
 
     public boolean canPurge () {
 //  --------------------------