X-Git-Url: https://git.argeo.org/?a=blobdiff_plain;f=org.argeo.api.acr%2Fsrc%2Forg%2Fargeo%2Fapi%2Facr%2Fspi%2FProvidedContent.java;h=3cf130a7c456d35e22c5d74e961bc1c2acc0ffd1;hb=e5f2dcdb553b5da76c7727af8aa24c83ed397d35;hp=e2807c0efd19e746c7a9ab41a2971e36c1fe55e9;hpb=ea7d6818525ff88cc6b9ed0957c912545bd8eb81;p=lgpl%2Fargeo-commons.git diff --git a/org.argeo.api.acr/src/org/argeo/api/acr/spi/ProvidedContent.java b/org.argeo.api.acr/src/org/argeo/api/acr/spi/ProvidedContent.java index e2807c0ef..3cf130a7c 100644 --- a/org.argeo.api.acr/src/org/argeo/api/acr/spi/ProvidedContent.java +++ b/org.argeo.api.acr/src/org/argeo/api/acr/spi/ProvidedContent.java @@ -12,6 +12,15 @@ public interface ProvidedContent extends Content { int getDepth(); + /** + * Whether this is the root node of the related repository. Default checks + * whether {@link #getDepth()} == 0, but it can be optimised by + * implementations. + */ + default boolean isRoot() { + return getDepth() == 0; + } + /** * An opaque ID which is guaranteed to uniquely identify this content within the * session return by {@link #getSession()}. Typically used for UI. @@ -32,4 +41,13 @@ public interface ProvidedContent extends Content { } return (ProvidedContent) fileNode; } + + /* + * ACCESS + */ + /** Whether the session has the right to access the parent. */ + default boolean isParentAccessible() { + return true; + } + }