Extend ACR api.
[lgpl/argeo-commons.git] / org.argeo.api.acr / src / org / argeo / api / acr / spi / ProvidedContent.java
index e2807c0efd19e746c7a9ab41a2971e36c1fe55e9..3cf130a7c456d35e22c5d74e961bc1c2acc0ffd1 100644 (file)
@@ -12,6 +12,15 @@ public interface ProvidedContent extends Content {
 
        int getDepth();
 
+       /**
+        * Whether this is the root node of the related repository. Default checks
+        * whether <code>{@link #getDepth()} == 0</code>, 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;
+       }
+
 }