Skip to content

Commit ed4d1ee

Browse files
rjrudinMarkLogic Builder
authored andcommitted
DHFPROD-4317: data-hub-security-admin can deploy privileges
1 parent 665a274 commit ed4d1ee

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

marklogic-data-hub/src/main/java/com/marklogic/hub/dhs/DhsDeployer.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import com.marklogic.appdeployer.command.alert.DeployAlertRulesCommand;
99
import com.marklogic.appdeployer.command.databases.DeployOtherDatabasesCommand;
1010
import com.marklogic.appdeployer.command.schemas.LoadSchemasCommand;
11+
import com.marklogic.appdeployer.command.security.DeployPrivilegesCommand;
1112
import com.marklogic.appdeployer.command.security.DeployRolesCommand;
1213
import com.marklogic.appdeployer.command.tasks.DeployScheduledTasksCommand;
1314
import com.marklogic.appdeployer.command.temporal.DeployTemporalAxesCommand;
@@ -154,6 +155,7 @@ protected void setKnownValuesForDhsDeployment(HubConfig hubConfig) {
154155

155156
protected List<Command> buildCommandsForSecurityAdmin() {
156157
List<Command> commands = new ArrayList<>();
158+
commands.add(new DeployPrivilegesCommand());
157159
commands.add(new DeployRolesCommand());
158160
return commands;
159161
}

marklogic-data-hub/src/test/java/com/marklogic/hub/dhs/DeployAsSecurityAdminTest.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.marklogic.hub.dhs;
22

33
import com.marklogic.appdeployer.command.Command;
4+
import com.marklogic.appdeployer.command.security.DeployPrivilegesCommand;
45
import com.marklogic.appdeployer.command.security.DeployRolesCommand;
56
import org.junit.jupiter.api.Test;
67

@@ -14,8 +15,10 @@ public class DeployAsSecurityAdminTest {
1415
@Test
1516
void buildCommands() {
1617
List<Command> commands = new DhsDeployer().buildCommandsForSecurityAdmin();
17-
assertEquals(1, commands.size());
18-
assertTrue(commands.get(0) instanceof DeployRolesCommand,
19-
"As of 5.2.0, a data-hub-security-admin can only deploy roles");
18+
assertEquals(2, commands.size());
19+
20+
// As of 5.2.0, a data-hub-security-admin can only deploy roles and privileges
21+
assertTrue(commands.get(0) instanceof DeployPrivilegesCommand);
22+
assertTrue(commands.get(1) instanceof DeployRolesCommand);
2023
}
2124
}

0 commit comments

Comments
 (0)