Class HierarchicalEnvironment
- Direct Known Subclasses:
HierarchicalContextEnvironment,HierarchicalInstanceEnvironment
- Author:
- Luca Frosini (ISTI - CNR) Base class for all environments which have a hierarchy. An example is InstanceEnvironment where the instances belonging to a context must be visible from parent context if the requesting client has enough privileges
-
Nested Class Summary
Nested classes/interfaces inherited from class org.gcube.informationsystem.resourceregistry.environments.Environment
Environment.PermissionMode, Environment.SecurityType -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected Set<HierarchicalEnvironment>The set of child environments in the hierarchy.static final StringThe hierarchical indicator suffix used in role or user name construction.static final StringPrefix for the "Hierarchical Active-only" reader channel: a second, parallel hierarchical-reader role/user pair, independent ofH, used only by non-administrative hierarchical instance reads.protected booleanFlag indicating if hierarchical mode is active for the current request context.protected HierarchicalEnvironmentThe parent environment in the hierarchy.Fields inherited from class org.gcube.informationsystem.resourceregistry.environments.Environment
allOperationAllowedRoles, CONTEXT_MANAGER, contextSubtreeOperationAllowedRoles, DEFAULT_READER_ROLE, DEFAULT_WRITER_ROLE, environmentUUID, INFRASTRUCTURE_MANAGER, instanceOperationAllowedRoles, IS_ADMIN, IS_INSTANCE_OPERATOR, IS_MANAGER, stateOverrideAllowedRoles -
Constructor Summary
ConstructorsConstructorDescriptionHierarchicalEnvironment(UUID uuid) Creates a newHierarchicalEnvironmentinstance. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddActiveReaderRoleToParent(com.orientechnologies.orient.core.metadata.security.OSecurity oSecurity, com.orientechnologies.orient.core.metadata.security.ORole activeReaderRole) Propagates and adds the specifiedHAreader role up to this environment and (recursively) all of its own ancestors.voidaddElement(com.orientechnologies.orient.core.record.OElement element, com.orientechnologies.orient.core.db.document.ODatabaseDocument oDatabaseDocument) Adds an element to this environment within the specified database transaction.protected voidaddHierarchicalRoleToParent(com.orientechnologies.orient.core.metadata.security.OSecurity oSecurity, Environment.PermissionMode permissionMode, com.orientechnologies.orient.core.metadata.security.ORole... roles) Propagates and adds the specified hierarchical roles up to all parent environments.protected voidallow(com.orientechnologies.orient.core.metadata.security.OSecurity oSecurity, com.orientechnologies.orient.core.record.impl.ODocument oDocument, boolean hierarchic) Grants permissions to hierarchical write and read roles on the specified document vertex.protected voidallowActiveReader(com.orientechnologies.orient.core.metadata.security.OSecurity oSecurity, com.orientechnologies.orient.core.record.impl.ODocument oDocument) Grants read access to this environment's ownHA(active-only hierarchical reader) role on the specified document vertex.protected booleanallowed(com.orientechnologies.orient.core.metadata.security.ORole role, com.orientechnologies.orient.core.record.impl.ODocument oDocument) Returns whether the specified role is allowed to access the document vertex.voidchangeParentEnvironment(HierarchicalEnvironment newParentEnvironment, com.orientechnologies.orient.core.db.document.ODatabaseDocument orientGraph) Use to change the parent not to set the first time.protected voidcreateActiveReaderRoleAndUser(com.orientechnologies.orient.core.metadata.security.OSecurity oSecurity) Creates theHA(active-only hierarchical reader) role and user for this environment, reader-only, with no grant to any ancestor.protected voidcreateRolesAndUsers(com.orientechnologies.orient.core.metadata.security.OSecurity oSecurity) Creates both the non-hierarchical and theHhierarchical roles/users for this environment, overridingEnvironment.createRolesAndUsers(OSecurity)to also cover the hierarchical channel.protected voidcreateRolesAndUsers(com.orientechnologies.orient.core.metadata.security.OSecurity oSecurity, boolean hierarchical) Creates OrientDB security roles and users for all permission modes in this environment, optionally generating them in hierarchical context format.protected voiddeleteRolesAndUsers(com.orientechnologies.orient.core.metadata.security.OSecurity oSecurity) Deletes both the non-hierarchical and theHhierarchical roles/users for this environment, overridingEnvironment.deleteRolesAndUsers(OSecurity).protected voiddeny(com.orientechnologies.orient.core.metadata.security.OSecurity oSecurity, com.orientechnologies.orient.core.record.impl.ODocument oDocument, boolean hierarchical) Denies permissions to hierarchical write and read roles on the specified document vertex.protected voiddenyActiveReader(com.orientechnologies.orient.core.metadata.security.OSecurity oSecurity, com.orientechnologies.orient.core.record.impl.ODocument oDocument) Denies read access to this environment's ownHArole/user on the specified document vertex.Returns the children environments of this hierarchical environment.getContexts(com.orientechnologies.orient.core.record.OElement element) Returns the set of context UUID strings from the allowed security permissions of the element.protected com.orientechnologies.orient.core.metadata.security.OSecuritygetOSecurity(com.orientechnologies.orient.core.db.document.ODatabaseDocument oDatabaseDocument) Retrieves the security manager associated with the given database document.Returns the parent environment in the hierarchy.protected com.orientechnologies.orient.core.db.ODatabasePoolgetPool(Environment.PermissionMode permissionMode, boolean recreate) Retrieves or creates a database connection pool for the specified permission mode, distinguishing the hierarchical-mode username from the regular one.static StringgetRoleOrUserName(Environment.PermissionMode permissionMode, Environment.SecurityType securityType) Returns the standard role or user name based on permission mode and security type.static StringgetRoleOrUserName(Environment.PermissionMode permissionMode, Environment.SecurityType securityType, boolean hierarchic) Returns the standard role or user name with optional hierarchical indicator.static StringgetRoleOrUserName(Environment.PermissionMode permissionMode, Environment.SecurityType securityType, String hierarchicPrefix) getSecurityRoleOrUserName(Environment.PermissionMode permissionMode, Environment.SecurityType securityType, boolean hierarchic) Returns the context-scoped security role or user name.getSecurityRoleOrUserName(Environment.PermissionMode permissionMode, Environment.SecurityType securityType, String hierarchicPrefix) Returns the context-scoped security role or user name for an explicit hierarchical-channel prefix.voidgrantActiveReaderRoleToAncestors(com.orientechnologies.orient.core.db.document.ODatabaseDocument oDatabaseDocument) Public entry point forgrantActiveReaderRoleToAncestors(OSecurity), for callers outside this package (e.g.protected voidgrantActiveReaderRoleToAncestors(com.orientechnologies.orient.core.metadata.security.OSecurity oSecurity) booleanbooleanReturns whether hierarchical mode is active.protected voidremoveActiveReaderRoleFromMyHAUser(com.orientechnologies.orient.core.metadata.security.OSecurity oSecurity, String activeReaderRoleName) protected voidremoveChildrenHRolesFromMyHUsers(com.orientechnologies.orient.core.metadata.security.OSecurity oSecurity, Set<HierarchicalEnvironment> children) Revokes child hierarchical roles from the database users of this environment.protected voidremoveChildrenHRolesFromParents(com.orientechnologies.orient.core.metadata.security.OSecurity oSecurity) Revokes all hierarchical child roles from all parent database users in the hierarchy.protected voidremoveChildrenHRolesFromParents(com.orientechnologies.orient.core.metadata.security.OSecurity oSecurity, Set<HierarchicalEnvironment> parents, Set<HierarchicalEnvironment> children) Revokes the specified list of child roles from the specified list of parent database users.voidremoveElement(com.orientechnologies.orient.core.record.OElement element, com.orientechnologies.orient.core.db.document.ODatabaseDocument oDatabaseDocument) Removes an element from this environment within the specified database transaction.protected voidremoveHierarchicRoleFromMyHUser(com.orientechnologies.orient.core.metadata.security.OSecurity oSecurity, Environment.PermissionMode permissionMode, String roleName) Revokes a specific hierarchical role from the database user of this environment.voidrevokeActiveReaderRoleFromAncestors(com.orientechnologies.orient.core.db.document.ODatabaseDocument oDatabaseDocument) Public entry point forrevokeActiveReaderRoleFromAncestors(OSecurity), for callers outside this package (e.g.protected voidrevokeActiveReaderRoleFromAncestors(com.orientechnologies.orient.core.metadata.security.OSecurity oSecurity) voidsetActiveOnlyHierarchicalMode(boolean activeOnlyHierarchicalMode) voidsetHierarchicalMode(boolean hierarchicalMode) Sets whether hierarchical mode is active.voidsetParentEnvironment(HierarchicalEnvironment parentEnvironment) Sets the parent environment for this hierarchical context environment.Methods inherited from class org.gcube.informationsystem.resourceregistry.environments.Environment
addElement, addExtraRules, allow, create, create, delete, delete, deny, drop, getAllOperationsAllowedRoles, getAllowedRoles, getDatabaseDocument, getInstanceOperationAllowedRoles, getOrCreateRole, getOrCreateUser, getSecurityRoleOrUserName, getStateOverrideAllowedRoles, getSuperRole, getUUID, isElementInContext, isUserAllowed, removeElement, toString
-
Field Details
-
H
The hierarchical indicator suffix used in role or user name construction.- See Also:
-
HA
Prefix for the "Hierarchical Active-only" reader channel: a second, parallel hierarchical-reader role/user pair, independent ofH, used only by non-administrative hierarchical instance reads. UnlikeH(which always sees every descendant regardless ofeffectiveState, and is what administrative roles keep using unchanged), an environment'sHAReaderRole_<uuid>is granted to its ancestors'HAReaderUser_<uuid>only while its owneffectiveStateisACTIVE, and revoked while it is not - seeContextManagement.recomputeSubtreeDerivedFieldsSinglePass()for the trigger. Reader-only: there is noHAWriterRole/HAWriterUser, since hierarchical writes into a non-ACTIVE descendant are already rejected outright for non-administrative roles by an existing, separate check, with no "silently hide" equivalent needed for writes.- See Also:
-
hierarchicalMode
protected boolean hierarchicalModeFlag indicating if hierarchical mode is active for the current request context. -
activeOnlyHierarchicalMode
protected boolean activeOnlyHierarchicalModeFlag indicating that, while in hierarchical mode, theHA(active-only) reader channel must be used instead of the unrestrictedHchannel. Meaningless unlesshierarchicalModeis alsotrue; ignored forWRITERconnections (no active-only writer channel exists). Set by the PEP layer based on caller role: everyALL_ADMIN_ROLESholder keeps using the unrestrictedHchannel (unchanged behavior); every other role uses this one. -
parentEnvironment
The parent environment in the hierarchy. -
children
The set of child environments in the hierarchy.
-
-
Constructor Details
-
HierarchicalEnvironment
public HierarchicalEnvironment(UUID uuid) throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException Creates a newHierarchicalEnvironmentinstance.- Parameters:
uuid- the context environment UUID- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException- if the environment cannot be initialized
-
-
Method Details
-
isHierarchicalMode
public boolean isHierarchicalMode()Returns whether hierarchical mode is active.- Returns:
trueif hierarchical mode is active,falseotherwise
-
setHierarchicalMode
public void setHierarchicalMode(boolean hierarchicalMode) Sets whether hierarchical mode is active.- Parameters:
hierarchicalMode-trueto enable hierarchical mode,falseto disable it
-
isActiveOnlyHierarchicalMode
public boolean isActiveOnlyHierarchicalMode()Returns whether the active-only (HA) hierarchical reader channel must be used instead of the unrestrictedHchannel.- Returns:
trueif the active-only channel must be used,falseotherwise
-
setActiveOnlyHierarchicalMode
public void setActiveOnlyHierarchicalMode(boolean activeOnlyHierarchicalMode) Sets whether the active-only (HA) hierarchical reader channel must be used instead of the unrestrictedHchannel. See the field Javadoc for who should set this and when.- Parameters:
activeOnlyHierarchicalMode-trueto use the active-only channel
-
setParentEnvironment
Sets the parent environment for this hierarchical context environment.- Parameters:
parentEnvironment- the parent environment to set
-
getParentEnvironment
Returns the parent environment in the hierarchy.- Returns:
- the parent environment, or
nullif root
-
getChildren
Returns the children environments of this hierarchical environment.- Returns:
- the set of children
-
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- the new parent environment to transition toorientGraph- the active OrientDB database connection- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException- if the parent change or security update fails
-
getPool
protected com.orientechnologies.orient.core.db.ODatabasePool getPool(Environment.PermissionMode permissionMode, boolean recreate) Retrieves or creates a database connection pool for the specified permission mode, distinguishing the hierarchical-mode username from the regular one.Delegates to
ODatabasePoolManager, for the same reason asEnvironment.getPool(org.gcube.informationsystem.resourceregistry.environments.Environment.PermissionMode, boolean): this instance may itself be transient, so it must not own the pool's lifecycle.- Overrides:
getPoolin classEnvironment- Parameters:
permissionMode- the permission mode (READER/WRITER)recreate-trueto force recreation of the pool- Returns:
- the connection pool
-
getRoleOrUserName
public static String getRoleOrUserName(Environment.PermissionMode permissionMode, Environment.SecurityType securityType) Returns the standard role or user name based on permission mode and security type.- Parameters:
permissionMode- the permission modesecurityType- the security type- Returns:
- the role or user name string
-
getRoleOrUserName
public static String getRoleOrUserName(Environment.PermissionMode permissionMode, Environment.SecurityType securityType, boolean hierarchic) Returns the standard role or user name with optional hierarchical indicator.- Parameters:
permissionMode- the permission modesecurityType- the security typehierarchic-trueto prepand hierarchical prefix,falseotherwise- Returns:
- the role or user name string
-
getRoleOrUserName
public static String getRoleOrUserName(Environment.PermissionMode permissionMode, Environment.SecurityType securityType, String hierarchicPrefix) Returns the standard role or user name with an explicit hierarchical-channel prefix (""for non-hierarchical,Hfor the classic hierarchical channel,HAfor the active-only hierarchical channel).- Parameters:
permissionMode- the permission modesecurityType- the security typehierarchicPrefix- the hierarchical-channel prefix to prepend- Returns:
- the role or user name string
-
getSecurityRoleOrUserName
public String getSecurityRoleOrUserName(Environment.PermissionMode permissionMode, Environment.SecurityType securityType, boolean hierarchic) Returns the context-scoped security role or user name.- Parameters:
permissionMode- the permission modesecurityType- the security typehierarchic-trueto use hierarchical context,falseotherwise- Returns:
- the context-scoped role or user name string
-
getSecurityRoleOrUserName
public String getSecurityRoleOrUserName(Environment.PermissionMode permissionMode, Environment.SecurityType securityType, String hierarchicPrefix) Returns the context-scoped security role or user name for an explicit hierarchical-channel prefix. SeegetRoleOrUserName(PermissionMode, SecurityType, String).- Parameters:
permissionMode- the permission modesecurityType- the security typehierarchicPrefix- the hierarchical-channel prefix to prepend- Returns:
- the context-scoped role or user name string
-
getOSecurity
protected com.orientechnologies.orient.core.metadata.security.OSecurity getOSecurity(com.orientechnologies.orient.core.db.document.ODatabaseDocument oDatabaseDocument) Retrieves the security manager associated with the given database document.- Parameters:
oDatabaseDocument- the database session document- Returns:
- the OrientDB security manager
-
getContexts
Returns the set of context UUID strings from the allowed security permissions of the element. A permission whose role or user record no longer exists grants nothing and is skipped: it is left by the deletion of a Context in an older version, whose roles were dropped while the links to them stayed.- Parameters:
element- the OrientDB element- Returns:
- the set of context UUIDs
-
allow
protected void allow(com.orientechnologies.orient.core.metadata.security.OSecurity oSecurity, com.orientechnologies.orient.core.record.impl.ODocument oDocument, boolean hierarchic) Grants permissions to hierarchical write and read roles on the specified document vertex.- Parameters:
oSecurity- the security manageroDocument- the document vertexhierarchic-trueto use hierarchical role scoping,falseotherwise
-
allowActiveReader
protected void allowActiveReader(com.orientechnologies.orient.core.metadata.security.OSecurity oSecurity, com.orientechnologies.orient.core.record.impl.ODocument oDocument) Grants read access to this environment's ownHA(active-only hierarchical reader) role on the specified document vertex. Reader-only, mirroring the read half ofallow(OSecurity, ODocument, boolean)- there is no active-only writer channel.- Parameters:
oSecurity- the security manageroDocument- the document vertex
-
addElement
public void addElement(com.orientechnologies.orient.core.record.OElement element, com.orientechnologies.orient.core.db.document.ODatabaseDocument oDatabaseDocument) Description copied from class:EnvironmentAdds an element to this environment within the specified database transaction.- Overrides:
addElementin classEnvironment- Parameters:
element- the element to addoDatabaseDocument- the database connection
-
deny
protected void deny(com.orientechnologies.orient.core.metadata.security.OSecurity oSecurity, com.orientechnologies.orient.core.record.impl.ODocument oDocument, boolean hierarchical) Denies permissions to hierarchical write and read roles on the specified document vertex.- Parameters:
oSecurity- the security manageroDocument- the document vertexhierarchical-trueto use hierarchical role scoping,falseotherwise
-
denyActiveReader
protected void denyActiveReader(com.orientechnologies.orient.core.metadata.security.OSecurity oSecurity, com.orientechnologies.orient.core.record.impl.ODocument oDocument) Denies read access to this environment's ownHArole/user on the specified document vertex. Mirrors the read half ofdeny(OSecurity, ODocument, boolean).- Parameters:
oSecurity- the security manageroDocument- the document vertex
-
removeElement
public void removeElement(com.orientechnologies.orient.core.record.OElement element, com.orientechnologies.orient.core.db.document.ODatabaseDocument oDatabaseDocument) Description copied from class:EnvironmentRemoves an element from this environment within the specified database transaction.- Overrides:
removeElementin classEnvironment- Parameters:
element- the element to removeoDatabaseDocument- the database connection
-
allowed
protected boolean allowed(com.orientechnologies.orient.core.metadata.security.ORole role, com.orientechnologies.orient.core.record.impl.ODocument oDocument) Description copied from class:EnvironmentReturns whether the specified role is allowed to access the document vertex.- Overrides:
allowedin classEnvironment- Parameters:
role- the security role to checkoDocument- the document vertex- Returns:
trueif the role is allowed,falseotherwise
-
addHierarchicalRoleToParent
protected void addHierarchicalRoleToParent(com.orientechnologies.orient.core.metadata.security.OSecurity oSecurity, Environment.PermissionMode permissionMode, com.orientechnologies.orient.core.metadata.security.ORole... roles) Propagates and adds the specified hierarchical roles up to all parent environments.- Parameters:
oSecurity- the security managerpermissionMode- the permission mode (READER/WRITER)roles- the roles to propagate
-
grantActiveReaderRoleToAncestors
public void grantActiveReaderRoleToAncestors(com.orientechnologies.orient.core.db.document.ODatabaseDocument oDatabaseDocument) Public entry point forgrantActiveReaderRoleToAncestors(OSecurity), for callers outside this package (e.g.ContextManagement, on aneffectiveStatetransition toACTIVE) that only have anODatabaseDocumentat hand.- Parameters:
oDatabaseDocument- the active OrientDB database connection
-
revokeActiveReaderRoleFromAncestors
public void revokeActiveReaderRoleFromAncestors(com.orientechnologies.orient.core.db.document.ODatabaseDocument oDatabaseDocument) Public entry point forrevokeActiveReaderRoleFromAncestors(OSecurity), for callers outside this package (e.g.ContextManagement, on aneffectiveStatetransition away fromACTIVE) that only have anODatabaseDocumentat hand.- Parameters:
oDatabaseDocument- the active OrientDB database connection
-
grantActiveReaderRoleToAncestors
protected void grantActiveReaderRoleToAncestors(com.orientechnologies.orient.core.metadata.security.OSecurity oSecurity) Grants this environment's ownHAreader role to every one of its ancestors'HAreader users, all the way to the root. Called when this environment's owneffectiveStatetransitions toACTIVE(including the very first such transition, out of the initialCREATEDstate - seecreateActiveReaderRoleAndUser(OSecurity)'s Javadoc for why nothing is granted at role-creation time itself).A no-op if this environment has no parent (root Context).
- Parameters:
oSecurity- the OrientDB security manager
-
addActiveReaderRoleToParent
protected void addActiveReaderRoleToParent(com.orientechnologies.orient.core.metadata.security.OSecurity oSecurity, com.orientechnologies.orient.core.metadata.security.ORole activeReaderRole) Propagates and adds the specifiedHAreader role up to this environment and (recursively) all of its own ancestors.- Parameters:
oSecurity- the security manageractiveReaderRole- theHAreader role being propagated (some descendant's own)
-
revokeActiveReaderRoleFromAncestors
protected void revokeActiveReaderRoleFromAncestors(com.orientechnologies.orient.core.metadata.security.OSecurity oSecurity) Revokes this environment's ownHAreader role from every one of its ancestors'HAreader users, all the way to the root. Called when this environment's owneffectiveStatetransitions away fromACTIVE(toSUSPENDEDorCREATED).A no-op if this environment has no parent (root Context).
- Parameters:
oSecurity- the OrientDB security manager
-
removeActiveReaderRoleFromMyHAUser
protected void removeActiveReaderRoleFromMyHAUser(com.orientechnologies.orient.core.metadata.security.OSecurity oSecurity, String activeReaderRoleName) Revokes the specifiedHAreader role name from this environment's ownHAreader user, then (recursively) from all of its own ancestors.- Parameters:
oSecurity- the security manageractiveReaderRoleName- the role name being revoked (some descendant's own)
-
createRolesAndUsers
protected void createRolesAndUsers(com.orientechnologies.orient.core.metadata.security.OSecurity oSecurity) Creates both the non-hierarchical and theHhierarchical roles/users for this environment, overridingEnvironment.createRolesAndUsers(OSecurity)to also cover the hierarchical channel. Does not create theHAactive-only reader role/user — that channel is created separately, only where it is actually needed, viacreateActiveReaderRoleAndUser(OSecurity).- Overrides:
createRolesAndUsersin classEnvironment- Parameters:
oSecurity- the OrientDB security manager
-
createRolesAndUsers
protected void createRolesAndUsers(com.orientechnologies.orient.core.metadata.security.OSecurity oSecurity, boolean hierarchical) Creates OrientDB security roles and users for all permission modes in this environment, optionally generating them in hierarchical context format.- Parameters:
oSecurity- the OrientDB security managerhierarchical-trueto create hierarchical-scoped roles and users,falseotherwise
-
createActiveReaderRoleAndUser
protected void createActiveReaderRoleAndUser(com.orientechnologies.orient.core.metadata.security.OSecurity oSecurity) Creates theHA(active-only hierarchical reader) role and user for this environment, reader-only, with no grant to any ancestor.Unlike the
Hchannel, this deliberately does not propagate a grant to the parent environment at creation time - a brand new Context always starts witheffectiveState=CREATED(neverACTIVE, seeContextManagement.reallyCreate()), so there is nothing to grant yet. The grant to ancestors is added later, uniformly, the first time (and every subsequent time) this environment's owneffectiveStatetransitions toACTIVE- seegrantActiveReaderRoleToAncestors(OSecurity)and its revoke counterpart, triggered fromContextManagement.recomputeSubtreeDerivedFieldsSinglePass().- Parameters:
oSecurity- the OrientDB security manager
-
removeChildrenHRolesFromParents
protected void removeChildrenHRolesFromParents(com.orientechnologies.orient.core.metadata.security.OSecurity oSecurity) Revokes all hierarchical child roles from all parent database users in the hierarchy.- Parameters:
oSecurity- the security manager
-
removeChildrenHRolesFromParents
protected void removeChildrenHRolesFromParents(com.orientechnologies.orient.core.metadata.security.OSecurity oSecurity, Set<HierarchicalEnvironment> parents, Set<HierarchicalEnvironment> children) Revokes the specified list of child roles from the specified list of parent database users.- Parameters:
oSecurity- the security managerparents- the set of parent environmentschildren- the set of child environments
-
removeChildrenHRolesFromMyHUsers
protected void removeChildrenHRolesFromMyHUsers(com.orientechnologies.orient.core.metadata.security.OSecurity oSecurity, Set<HierarchicalEnvironment> children) Revokes child hierarchical roles from the database users of this environment.- Parameters:
oSecurity- the security managerchildren- the set of child environments whose roles to revoke
-
removeHierarchicRoleFromMyHUser
protected void removeHierarchicRoleFromMyHUser(com.orientechnologies.orient.core.metadata.security.OSecurity oSecurity, Environment.PermissionMode permissionMode, String roleName) Revokes a specific hierarchical role from the database user of this environment.- Parameters:
oSecurity- the security managerpermissionMode- the permission mode (READER/WRITER)roleName- the name of the role to revoke
-
deleteRolesAndUsers
protected void deleteRolesAndUsers(com.orientechnologies.orient.core.metadata.security.OSecurity oSecurity) Deletes both the non-hierarchical and theHhierarchical roles/users for this environment, overridingEnvironment.deleteRolesAndUsers(OSecurity). Before dropping the hierarchical roles/users themselves, first revokes this environment's own children's hierarchical roles from every ancestor's hierarchical user, viaremoveChildrenHRolesFromParents(OSecurity). Does not touch theHAactive-only reader role/user.- Overrides:
deleteRolesAndUsersin classEnvironment- Parameters:
oSecurity- the OrientDB security manager
-