if (env.isDas() && DeploymentUtils.isDomainTarget(target)) {
for (Map.Entry<String,Set<String>> entry : enabledVersionsInTargets.entrySet()) {
for (String t : entry.getValue()) {
final String resourceForApp = DeploymentCommandUtils.getTargetResourceNameForExistingApp(domain, t, entry.getKey());
if (resourceForApp != null) {
accessChecks.add(new AccessCheck(resourceForApp, DISABLE_ACTION));
}
}
}
} else if ( isVersionExpressionWithWildcard ){
for (String appNm : matchedVersions) {
final String resourceForApp = DeploymentCommandUtils.getTargetResourceNameForExistingAppRef(domain, target, appNm);
accessChecks.add(new AccessCheck(resourceForApp, DISABLE_ACTION));
}
} else if (target == null) {
final String resourceForApp = DeploymentCommandUtils.getTargetResourceNameForExistingAppRef(domain,
deployment.getDefaultTarget(appName, origin, _classicstyle), appName);
if (resourceForApp != null) {
accessChecks.add(new AccessCheck(resourceForApp, DISABLE_ACTION));
}
} else {
final String resourceForApp = DeploymentCommandUtils.getTargetResourceNameForExistingAppRef(domain, target, appName);
if (resourceForApp != null) {
accessChecks.add(new AccessCheck(resourceForApp, DISABLE_ACTION));
}
}
final String resourceForApp = DeploymentCommandUtils.getResourceNameForExistingApp(domain, appName);
if (resourceForApp != null) {
accessChecks.add(new AccessCheck(resourceForApp, DISABLE_ACTION));
}
return accessChecks;
}