summaryrefslogtreecommitdiffstats
path: root/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest
diff options
context:
space:
mode:
authortalig <talig@amdocs.com>2018-05-23 11:38:51 +0300
committerAvi Gaffa <avi.gaffa@amdocs.com>2018-05-23 09:09:03 +0000
commit66b0d09b07a0d16daacbb4c08da8cfe7e55bc28b (patch)
treef94de8fab9b97733fcc1a70fbf4fd4ba5eb008fc /openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest
parent134783cf629d515f35df39d1e0a583ecf8ffdc56 (diff)
Fix bug in change item owner
Change-Id: I200387d41f95d61ad0f6be6663b8d8fac198aa90 Issue-ID: SDC-1355 Signed-off-by: talig <talig@amdocs.com>
Diffstat (limited to 'openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest')
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/VendorLicenseModelsImpl.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/VendorLicenseModelsImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/VendorLicenseModelsImpl.java
index f596a8dd1b..3f4749d98d 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/VendorLicenseModelsImpl.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/services/VendorLicenseModelsImpl.java
@@ -300,9 +300,10 @@ public class VendorLicenseModelsImpl implements VendorLicenseModels {
}
private boolean userHasPermission(String itemId, String userId) {
- String permission = permissionsManager.getUserItemPermission(itemId, userId);
- return (permission != null && permission.matches(
- PermissionTypes.Contributor.name() + "|" + PermissionTypes.Owner.name()));
+ return permissionsManager.getUserItemPermission(itemId, userId)
+ .map(permission -> permission
+ .matches(PermissionTypes.Contributor.name() + "|" + PermissionTypes.Owner.name()))
+ .orElse(false);
}
private Predicate<Item> createItemPredicate(String versionStatus, String itemStatus, String user) {