@Override
public Collection<? extends AccessCheck> getAccessChecks() {
final List<AccessCheck> accessChecks = new ArrayList<AccessCheck>();
accessChecks.add(new AccessCheck(DeploymentCommandUtils.getResourceNameForApps(domain), "create"));
accessChecks.add(new AccessCheck(DeploymentCommandUtils.getTargetResourceNameForNewAppRef(domain, target), "create"));
/*
* If this app is already deployed then this operation also represents
* an undeployment - a delete - of that app.
*/
if (isredeploy) {
final String appResource = DeploymentCommandUtils.getResourceNameForNewApp(domain, name);
accessChecks.add(new AccessCheck(appResource, "delete"));
final String appRefResource = DeploymentCommandUtils.getTargetResourceNameForNewAppRef(domain, target, name);
accessChecks.add(new AccessCheck(appRefResource, "delete"));
}
return accessChecks;
}