From 66b0d09b07a0d16daacbb4c08da8cfe7e55bc28b Mon Sep 17 00:00:00 2001 From: talig Date: Wed, 23 May 2018 11:38:51 +0300 Subject: Fix bug in change item owner Change-Id: I200387d41f95d61ad0f6be6663b8d8fac198aa90 Issue-ID: SDC-1355 Signed-off-by: talig --- .../vendorlicense/rest/services/VendorLicenseModelsImpl.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src') 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 createItemPredicate(String versionStatus, String itemStatus, String user) { -- cgit 1.2.3-korg