X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.structural2%2Fsrc%2Forg%2Fsimantics%2Fstructural2%2Futils%2FStructuralUtils.java;h=aac19a7f176b663c9297e9e3b820e86e44392992;hp=e27d92f29219a7f54963208286b5bd1936c0f485;hb=06aeb7cad707d1fed2c21c1ad9413aa97e901da7;hpb=38d133f2a39bab76deed5d047fbabee4479b5373 diff --git a/bundles/org.simantics.structural2/src/org/simantics/structural2/utils/StructuralUtils.java b/bundles/org.simantics.structural2/src/org/simantics/structural2/utils/StructuralUtils.java index e27d92f29..aac19a7f1 100644 --- a/bundles/org.simantics.structural2/src/org/simantics/structural2/utils/StructuralUtils.java +++ b/bundles/org.simantics.structural2/src/org/simantics/structural2/utils/StructuralUtils.java @@ -308,11 +308,13 @@ public class StructuralUtils { } public static boolean isImmutable(ReadGraph graph, Resource r) throws DatabaseException { + // Marking a resource L0.readOnly also makes it immutable + if (graph.isImmutable(r) || Layer0Utils.isMarkedReadOnly(graph, r)) + return true; StructuralResource2 STR = StructuralResource2.getInstance(graph); Resource uc = graph.syncRequest(new PossibleTypedParent(r, STR.ComponentType)); - return graph.isImmutable(r) - // Anything under a published or locked user component is published as well - || (uc != null && (Layer0Utils.isPublished(graph, uc) + return // Anything under a published or locked user component is published as well + (uc != null && (Layer0Utils.isPublished(graph, uc) || graph.hasStatement(uc, STR.ComponentType_Locked))) // Anything under a published container (shared library) is published as well || Layer0Utils.isContainerPublished(graph, r)