Skip to content
This repository was archived by the owner on Sep 16, 2024. It is now read-only.

Commit a98fc26

Browse files
committed
#277 Removing role deployment via CMA for now
1 parent f0636dd commit a98fc26

File tree

5 files changed

+1
-43
lines changed

5 files changed

+1
-43
lines changed

src/main/java/com/marklogic/appdeployer/AppConfig.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ public class AppConfig {
6969

7070
private boolean deployAmpsWithCma = false;
7171
private boolean deployForestsWithCma = false;
72-
private boolean deployRolesWithCma = false;
7372
private boolean deployPrivilegesWithCma = false;
7473

7574
// Used to construct DatabaseClient instances based on inputs defined in this class
@@ -1263,14 +1262,6 @@ public void setCreateTriggersDatabase(boolean createTriggerDatabase) {
12631262
this.createTriggersDatabase = createTriggerDatabase;
12641263
}
12651264

1266-
public boolean isDeployRolesWithCma() {
1267-
return deployRolesWithCma;
1268-
}
1269-
1270-
public void setDeployRolesWithCma(boolean deployRolesWithCma) {
1271-
this.deployRolesWithCma = deployRolesWithCma;
1272-
}
1273-
12741265
public boolean isDeployPrivilegesWithCma() {
12751266
return deployPrivilegesWithCma;
12761267
}

src/main/java/com/marklogic/appdeployer/DefaultAppConfigFactory.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,6 @@ public void initialize() {
6363
config.setDeployPrivilegesWithCma(Boolean.parseBoolean(prop));
6464
});
6565

66-
propertyConsumerMap.put("mlDeployRolesWithCma", (config, prop) -> {
67-
logger.info("Deploy roles" + cmaMessage + prop);
68-
config.setDeployRolesWithCma(Boolean.parseBoolean(prop));
69-
});
70-
7166
/**
7267
* The application name is used as a prefix for default names for a variety of resources, such as REST API servers
7368
* and databases.

src/main/java/com/marklogic/appdeployer/command/security/DeployRolesCommand.java

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,19 @@
33
import com.marklogic.appdeployer.command.AbstractResourceCommand;
44
import com.marklogic.appdeployer.command.CommandContext;
55
import com.marklogic.appdeployer.command.SortOrderConstants;
6-
import com.marklogic.appdeployer.command.SupportsCmaCommand;
76
import com.marklogic.mgmt.SaveReceipt;
87
import com.marklogic.mgmt.api.API;
9-
import com.marklogic.mgmt.api.configuration.Configuration;
108
import com.marklogic.mgmt.api.security.Role;
119
import com.marklogic.mgmt.mapper.DefaultResourceMapper;
1210
import com.marklogic.mgmt.mapper.ResourceMapper;
1311
import com.marklogic.mgmt.resource.ResourceManager;
1412
import com.marklogic.mgmt.resource.security.RoleManager;
15-
import org.springframework.http.ResponseEntity;
1613

1714
import java.io.File;
1815
import java.util.HashSet;
1916
import java.util.Set;
2017

21-
public class DeployRolesCommand extends AbstractResourceCommand implements SupportsCmaCommand {
18+
public class DeployRolesCommand extends AbstractResourceCommand {
2219

2320
// Used internally
2421
private boolean removeRolesAndPermissionsDuringDeployment = false;
@@ -32,16 +29,6 @@ public DeployRolesCommand() {
3229
setUndoSortOrder(SortOrderConstants.DELETE_ROLES);
3330
}
3431

35-
@Override
36-
public boolean cmaShouldBeUsed(CommandContext context) {
37-
return context.getAppConfig().isDeployRolesWithCma();
38-
}
39-
40-
@Override
41-
public void addResourceToConfiguration(String payload, ResourceMapper resourceMapper, Configuration configuration) {
42-
configuration.addRole(resourceMapper.readResource(payload, Role.class));
43-
}
44-
4532
/**
4633
* The set of roles is processed twice. The first time, the roles are saved without any default permissions or references to other roles.
4734
* This is to avoid issues where the roles refer to each other or to themselves (via default permissions). The second time, the roles are

src/test/java/com/marklogic/appdeployer/DefaultAppConfigFactoryTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,6 @@ public void allProperties() {
213213
assertTrue(config.isDeployAmpsWithCma());
214214
assertTrue(config.isDeployForestsWithCma());
215215
assertTrue(config.isDeployPrivilegesWithCma());
216-
assertTrue(config.isDeployRolesWithCma());
217216

218217
assertEquals("prophost", config.getHost());
219218
assertEquals("propname", config.getName());

src/test/java/com/marklogic/appdeployer/command/security/DeployRolesWithDependenciesTest.java

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -57,20 +57,6 @@ public void testEvenMoreRoles() {
5757
}
5858
}
5959

60-
@Test
61-
public void testEvenMoreRolesWithCma() {
62-
appConfig.getFirstConfigDir().setBaseDir(new File("src/test/resources/sample-app/even-more-roles-with-dependencies"));
63-
appConfig.setDeployRolesWithCma(true);
64-
65-
initializeAppDeployer(new TestDeployRolesCommand());
66-
try {
67-
deploySampleApp();
68-
} finally {
69-
initializeAppDeployer(new DeployRolesCommand());
70-
undeploySampleApp();
71-
}
72-
}
73-
7460
/**
7561
* This scenario tests that when two roles are next to each other with different dependencies - role1 and role2 -
7662
* that we figure out that role1 has a dependency on a role closest to the end of the current list of files.

0 commit comments

Comments
 (0)