From cf56167c6fd6b4793d7a9a52727a1e918e94c0cb Mon Sep 17 00:00:00 2001 From: mka Date: Wed, 17 Apr 2013 13:08:38 +0000 Subject: [PATCH] canPublish and canProtect operations are improved. --- Workspace/Siman-Common/src/org/splat/som/StudyRights.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Workspace/Siman-Common/src/org/splat/som/StudyRights.java b/Workspace/Siman-Common/src/org/splat/som/StudyRights.java index 6b53d4f..2eeff0e 100644 --- a/Workspace/Siman-Common/src/org/splat/som/StudyRights.java +++ b/Workspace/Siman-Common/src/org/splat/som/StudyRights.java @@ -116,8 +116,9 @@ public class StudyRights { * @return true if the user has right to edit the description. */ public boolean canPublish() { + int roleIndex = _user.getRole().getName().indexOf("knowledgineer"); return (_operand.getProgressState() == ProgressState.APPROVED && !_operand - .isPublic()/* && "knowledgineer".equals(_user.getRole().getName()) */); + .isPublic() && (roleIndex > -1)); } /** @@ -127,8 +128,9 @@ public class StudyRights { * @return true if the user has right to edit the description. */ public boolean canProtect() { + int roleIndex = _user.getRole().getName().indexOf("knowledgineer"); return (_operand.getProgressState() == ProgressState.APPROVED && _operand - .isPublic()/* && "knowledgineer".equals(_user.getRole().getName()) */); + .isPublic() && (roleIndex > -1)); } /** -- 2.39.2