class ResourcePermissionService {

    public void revokeAuthorizedEnvironmentsAndEnvironmentTypesPerApplication(AbstractSecurityEnabledResource resource, String[] applicationsToDelete,
                                                                              String[] environmentsToDelete, String[] environmentTypesToDelete) {
        IResourceSaver noSave = null;

        if (ArrayUtils.isNotEmpty(applicationsToDelete)) {
            revokePermission(resource, noSave, Subject.APPLICATION, applicationsToDelete);
        }
        if (ArrayUtils.isNotEmpty(environmentsToDelete)) {
            revokePermission(resource, noSave, Subject.ENVIRONMENT, environmentsToDelete);
        }
        if (ArrayUtils.isNotEmpty(environmentTypesToDelete)) {
            revokePermission(resource, noSave, Subject.ENVIRONMENT_TYPE, environmentTypesToDelete);
        }

        alienDAO.save(resource);
    }

}