Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjmisinco2011-11-10 17:50:00 +0000
committerRyan D. Brooks2011-11-10 17:50:00 +0000
commitbd88fa6d02fcef62d09772349f228e0aa43ab558 (patch)
treeaedb356fd60e8003849a5b35ee6e814a8f3cbf0d
parent96902a23a342ff4dee70fa671a68ee8718d32ad3 (diff)
downloadorg.eclipse.osee-bd88fa6d02fcef62d09772349f228e0aa43ab558.tar.gz
org.eclipse.osee-bd88fa6d02fcef62d09772349f228e0aa43ab558.tar.xz
org.eclipse.osee-bd88fa6d02fcef62d09772349f228e0aa43ab558.zip
bug[ats_NWC7Y]: Fix relation rationale is no longer editable0.9.9.v201111101536_SR3
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/RelationCellModifier.java15
1 files changed, 14 insertions, 1 deletions
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/RelationCellModifier.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/RelationCellModifier.java
index c3dfcc1374e..d468cdcf997 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/RelationCellModifier.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/RelationCellModifier.java
@@ -10,12 +10,15 @@
*******************************************************************************/
package org.eclipse.osee.framework.ui.skynet;
+import java.util.Arrays;
import java.util.logging.Level;
import org.eclipse.jface.viewers.ICellModifier;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.core.model.RelationTypeSide;
import org.eclipse.osee.framework.jdk.core.util.Strings;
import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.skynet.core.AccessPolicy;
import org.eclipse.osee.framework.skynet.core.relation.RelationLink;
import org.eclipse.osee.framework.skynet.core.relation.RelationManager;
import org.eclipse.osee.framework.ui.skynet.internal.Activator;
@@ -38,7 +41,17 @@ public class RelationCellModifier implements ICellModifier {
public boolean canModify(Object element, String property) {
if (element instanceof WrapperForRelationLink) {
WrapperForRelationLink relLink = (WrapperForRelationLink) element;
- return !(relLink.getArtifactA().isReadOnly() || relLink.getArtifactB().isReadOnly());
+ RelationTypeSide rts = new RelationTypeSide(relLink.getRelationType(), relLink.getRelationSide());
+ boolean canModify = false;
+ AccessPolicy policyHandlerService = Activator.getInstance().getAccessPolicy();
+ try {
+ canModify =
+ policyHandlerService.canRelationBeModified(relLink.getArtifactA(),
+ Arrays.asList(relLink.getArtifactB()), rts, Level.INFO).matched();
+ } catch (OseeCoreException ex) {
+ canModify = false;
+ }
+ return canModify;
}
return false;
}

Back to the top