summaryrefslogtreecommitdiffstats
path: root/openecomp-be/backend
diff options
context:
space:
mode:
Diffstat (limited to 'openecomp-be/backend')
-rw-r--r--openecomp-be/backend/openecomp-sdc-item-permissions-manager/src/main/java/org/openecomp/sdc/itempermissions/dao/impl/PermissionsManagerImpl.java7
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/VendorSoftwareProductManager.java2
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/VendorSoftwareProductManagerImpl.java5
3 files changed, 11 insertions, 3 deletions
diff --git a/openecomp-be/backend/openecomp-sdc-item-permissions-manager/src/main/java/org/openecomp/sdc/itempermissions/dao/impl/PermissionsManagerImpl.java b/openecomp-be/backend/openecomp-sdc-item-permissions-manager/src/main/java/org/openecomp/sdc/itempermissions/dao/impl/PermissionsManagerImpl.java
index 68edb21fd8..d25ea53dc2 100644
--- a/openecomp-be/backend/openecomp-sdc-item-permissions-manager/src/main/java/org/openecomp/sdc/itempermissions/dao/impl/PermissionsManagerImpl.java
+++ b/openecomp-be/backend/openecomp-sdc-item-permissions-manager/src/main/java/org/openecomp/sdc/itempermissions/dao/impl/PermissionsManagerImpl.java
@@ -82,7 +82,7 @@ public class PermissionsManagerImpl implements PermissionsManager {
new ErrorCode.ErrorCodeBuilder().withMessage(Messages.PERMISSIONS_ERROR.getErrorMessage()).withId(Messages.PERMISSIONS_ERROR.name())
.withCategory(ErrorCategory.SECURITY).build());
}
- if (permission.equals(PermissionTypes.Owner.name())) {
+ if (permission.equals(PermissionTypes.Owner.name()) && !addedUsersIds.isEmpty()) {
if (addedUsersIds.size() == 1) {
asdcItemManager.updateOwner(itemId, addedUsersIds.iterator().next());
} else {
@@ -96,12 +96,13 @@ public class PermissionsManagerImpl implements PermissionsManager {
private void sendNotifications(String itemId, String permission, Set<String> addedUsersIds, Set<String> removedUsersIds, String userName) {
Item item = asdcItemManager.get(itemId);
+ String itemName = null != item ? item.getName() : "";
addedUsersIds.forEach(affectedUser -> {
- notifyUser(userName, true, item.getName(), itemId, affectedUser, permission);
+ notifyUser(userName, true, itemName, itemId, affectedUser, permission);
subscriptionService.subscribe(affectedUser, itemId);
});
removedUsersIds.forEach(affectedUser -> {
- notifyUser(userName, false, item.getName(), itemId, affectedUser, permission);
+ notifyUser(userName, false, itemName, itemId, affectedUser, permission);
subscriptionService.unsubscribe(affectedUser, itemId);
});
}
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/VendorSoftwareProductManager.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/VendorSoftwareProductManager.java
index 6a92dbb209..5e59e795e6 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/VendorSoftwareProductManager.java
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/VendorSoftwareProductManager.java
@@ -58,6 +58,8 @@ public interface VendorSoftwareProductManager {
PackageInfo createPackage(String vspId, Version version) throws IOException;
+ void updatePackage(PackageInfo packageInfo);
+
List<PackageInfo> listPackages(String category, String subCategory);
File getTranslatedFile(String vspId, Version version);
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/VendorSoftwareProductManagerImpl.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/VendorSoftwareProductManagerImpl.java
index bf173a28be..234ee43f05 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/VendorSoftwareProductManagerImpl.java
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/VendorSoftwareProductManagerImpl.java
@@ -539,6 +539,11 @@ public class VendorSoftwareProductManagerImpl implements VendorSoftwareProductMa
}
@Override
+ public void updatePackage(PackageInfo packageInfo) {
+ packageInfoDao.update(packageInfo);
+ }
+
+ @Override
public PackageInfo createPackage(final String vspId, final Version version) throws IOException {
final ToscaServiceModel toscaServiceModel = enrichedServiceModelDao.getServiceModel(vspId, version);
final VspDetails vspDetails = vspInfoDao.get(new VspDetails(vspId, version));