bug4811: fixed removeSshKey regarding clean-up of ownership/access control store

This commit is contained in:
Axel Uhl committed 2021-01-21 23:14:18 +01:00
1 parent dfebfa60a9
commit fd217b4dbf
1 file changed
+2 -5
@@ -137,10 +137,7 @@ public class LandscapeManagementWriteServiceImpl extends ResultCachingProxiedRem
@Override
public void removeSshKey(String awsAccessKey, String awsSecret, SSHKeyPairDTO keyPair) {
SecurityUtils.getSubject().checkPermission(
SecuredLandscapeTypes.SSH_KEY.getStringPermissionForTypeRelativeIdentifier(DefaultActions.DELETE,
keyPair.getTypeRelativeObjectIdentifier()));
AwsLandscape
.obtain(awsAccessKey, awsSecret).deleteKeyPair(new AwsRegion(keyPair.getRegionId()), keyPair.getName());
getSecurityService().checkPermissionAndDeleteOwnershipForObjectRemoval(keyPair,
()->AwsLandscape.obtain(awsAccessKey, awsSecret).deleteKeyPair(new AwsRegion(keyPair.getRegionId()), keyPair.getName()));
}
}