public class CreateGranularPrivilegesCommand
extends com.marklogic.client.ext.helper.LoggingObject
implements com.marklogic.appdeployer.command.Command, com.marklogic.appdeployer.command.UndoableCommand
See the comments on saveGranularPrivileges for important information about how this class attempts to avoid causing an error by trying to create a privilege with the same action as an existing one.
Modifier and Type | Field and Description |
---|---|
static java.util.List<java.lang.String> |
ROLES_THAT_CAN_BE_INHERITED
Defines the roles that can be inherited when a data-hub-security-admin creates or edits a custom role.
|
Constructor and Description |
---|
CreateGranularPrivilegesCommand(HubConfig hubConfig) |
CreateGranularPrivilegesCommand(HubConfig hubConfig,
java.util.List<java.lang.String> groupNames) |
Modifier and Type | Method and Description |
---|---|
protected java.util.Map<java.lang.String,com.marklogic.mgmt.api.security.Privilege> |
buildGranularPrivileges(com.marklogic.mgmt.ManageClient manageClient) |
void |
execute(com.marklogic.appdeployer.command.CommandContext context) |
java.lang.Integer |
getExecuteSortOrder()
It is anticipated that these privileges can always be added at the end of a deployment because none of the steps
before that should depend on the privileges being added.
|
java.util.List<java.lang.String> |
getGroupNames() |
protected java.util.List<java.lang.String> |
getGroupNamesForScheduledTaskPrivileges() |
java.lang.Integer |
getUndoSortOrder() |
protected void |
saveGranularPrivileges(com.marklogic.mgmt.ManageClient manageClient,
java.util.Map<java.lang.String,com.marklogic.mgmt.api.security.Privilege> granularPrivileges)
Save each of the given privileges.
|
void |
undo(com.marklogic.appdeployer.command.CommandContext context)
Delete every granular privilege.
|
public static final java.util.List<java.lang.String> ROLES_THAT_CAN_BE_INHERITED
public CreateGranularPrivilegesCommand(HubConfig hubConfig)
public CreateGranularPrivilegesCommand(HubConfig hubConfig, java.util.List<java.lang.String> groupNames)
public java.lang.Integer getExecuteSortOrder()
getExecuteSortOrder
in interface com.marklogic.appdeployer.command.Command
public java.lang.Integer getUndoSortOrder()
getUndoSortOrder
in interface com.marklogic.appdeployer.command.UndoableCommand
public void execute(com.marklogic.appdeployer.command.CommandContext context)
execute
in interface com.marklogic.appdeployer.command.Command
public void undo(com.marklogic.appdeployer.command.CommandContext context)
undo
in interface com.marklogic.appdeployer.command.UndoableCommand
context
- protected java.util.Map<java.lang.String,com.marklogic.mgmt.api.security.Privilege> buildGranularPrivileges(com.marklogic.mgmt.ManageClient manageClient)
manageClient
- protected void saveGranularPrivileges(com.marklogic.mgmt.ManageClient manageClient, java.util.Map<java.lang.String,com.marklogic.mgmt.api.security.Privilege> granularPrivileges)
manageClient
- granularPrivileges
- protected java.util.List<java.lang.String> getGroupNamesForScheduledTaskPrivileges()
public java.util.List<java.lang.String> getGroupNames()