Class HierarchicalEnvironment

  • Direct Known Subclasses:
    InstanceEnvironment

    public abstract class HierarchicalEnvironment
    extends Environment
    Author:
    Luca Frosini (ISTI - CNR) Base class for all environments which have an hierarchy. An example is InstanceEnviroment where the instances belonging to a context must be visible from parent context if the requesting client has enough privileges
    • Constructor Detail

      • HierarchicalEnvironment

        public HierarchicalEnvironment​(UUID uuid)
                                throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
        Throws:
        org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
    • Method Detail

      • isHierarchicalMode

        protected boolean isHierarchicalMode()
      • changeParentEnvironment

        public void changeParentEnvironment​(HierarchicalEnvironment newParentEnvironment,
                                            com.orientechnologies.orient.core.db.document.ODatabaseDocument orientGraph)
                                     throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
        Use to change the parent not to set the first time
        Parameters:
        newParentEnvironment -
        orientGraph -
        Throws:
        org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
      • getContexts

        public static Set<String> getContexts​(com.orientechnologies.orient.core.record.OElement element)
      • allow

        protected void allow​(com.orientechnologies.orient.core.metadata.security.OSecurity oSecurity,
                             com.orientechnologies.orient.core.record.impl.ODocument oDocument,
                             boolean hierarchic)
      • addElement

        public void addElement​(com.orientechnologies.orient.core.record.OElement element,
                               com.orientechnologies.orient.core.db.document.ODatabaseDocument oDatabaseDocument)
        Overrides:
        addElement in class Environment
      • deny

        protected void deny​(com.orientechnologies.orient.core.metadata.security.OSecurity oSecurity,
                            com.orientechnologies.orient.core.record.impl.ODocument oDocument,
                            boolean hierarchical)
      • removeElement

        public void removeElement​(com.orientechnologies.orient.core.record.OElement element,
                                  com.orientechnologies.orient.core.db.document.ODatabaseDocument oDatabaseDocument)
        Overrides:
        removeElement in class Environment
      • allowed

        protected boolean allowed​(com.orientechnologies.orient.core.metadata.security.ORole role,
                                  com.orientechnologies.orient.core.record.impl.ODocument oDocument)
        Overrides:
        allowed in class Environment
      • addHierarchicalRoleToParent

        protected void addHierarchicalRoleToParent​(com.orientechnologies.orient.core.metadata.security.OSecurity oSecurity,
                                                   Environment.PermissionMode permissionMode,
                                                   com.orientechnologies.orient.core.metadata.security.ORole... roles)
      • createRolesAndUsers

        protected void createRolesAndUsers​(com.orientechnologies.orient.core.metadata.security.OSecurity oSecurity)
        Overrides:
        createRolesAndUsers in class Environment
      • removeChildrenHRolesFromParents

        protected void removeChildrenHRolesFromParents​(com.orientechnologies.orient.core.metadata.security.OSecurity oSecurity)
      • removeChildrenHRolesFromMyHUsers

        protected void removeChildrenHRolesFromMyHUsers​(com.orientechnologies.orient.core.metadata.security.OSecurity oSecurity,
                                                        Set<HierarchicalEnvironment> children)
      • removeHierarchicRoleFromMyHUser

        protected void removeHierarchicRoleFromMyHUser​(com.orientechnologies.orient.core.metadata.security.OSecurity oSecurity,
                                                       Environment.PermissionMode permissionMode,
                                                       String roleName)
      • deleteRolesAndUsers

        protected void deleteRolesAndUsers​(com.orientechnologies.orient.core.metadata.security.OSecurity oSecurity)
        Overrides:
        deleteRolesAndUsers in class Environment