Improve role management
[lgpl/argeo-commons.git] / org.argeo.api.cms / src / org / argeo / api / cms / directory / HierarchyUnit.java
index 04593d94e428ef766fa87831fbaa0f3c745aaee7..f04dc4648637f9ca3c3197f584f7e70b41411998 100644 (file)
@@ -26,7 +26,11 @@ public interface HierarchyUnit {
         * @return <code>true</code> if functional, <code>false</code> is technical
         *         (e.g. People, Groups, etc.)
         */
-       boolean isFunctional();
+       default boolean isFunctional() {
+               return isType(Type.FUNCTIONAL);
+       }
+
+       boolean isType(Type type);
 
        /**
         * The base of this organisational unit within the hierarchy. This would
@@ -39,4 +43,11 @@ public interface HierarchyUnit {
 
        /** Its metadata (typically LDAP attributes). */
        Dictionary<String, Object> getProperties();
+
+       enum Type {
+               PEOPLE, //
+               GROUPS, //
+               ROLES, //
+               FUNCTIONAL;
+       }
 }