From 8dfa832a4bbe276fdf898330325321a776ac253e Mon Sep 17 00:00:00 2001 From: ayalaben Date: Tue, 10 Apr 2018 13:43:01 +0300 Subject: User Permission items Change-Id: Ice1d126dd29e9f49ca90ada7b1671c72545c9ee8 Issue-ID: SDC-1202 Signed-off-by: ayalaben --- .../rest/services/ItemPermissionsImpl.java | 28 ++++++++++++++++------ 1 file changed, 21 insertions(+), 7 deletions(-) (limited to 'openecomp-be/api/openecomp-sdc-rest-webapp/item-permissions-rest/item-permissions-rest-services') diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/item-permissions-rest/item-permissions-rest-services/src/main/java/org/openecomp/sdcrests/itempermissions/rest/services/ItemPermissionsImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/item-permissions-rest/item-permissions-rest-services/src/main/java/org/openecomp/sdcrests/itempermissions/rest/services/ItemPermissionsImpl.java index 4fe93c20ac..213af650f7 100644 --- a/openecomp-be/api/openecomp-sdc-rest-webapp/item-permissions-rest/item-permissions-rest-services/src/main/java/org/openecomp/sdcrests/itempermissions/rest/services/ItemPermissionsImpl.java +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/item-permissions-rest/item-permissions-rest-services/src/main/java/org/openecomp/sdcrests/itempermissions/rest/services/ItemPermissionsImpl.java @@ -1,9 +1,23 @@ -//package org.openecomp.sdcrests.itempermissions.rest.mapping.mapping.services; +/* + * Copyright © 2016-2018 European Support Limited + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.openecomp.sdcrests.itempermissions.rest.services; -import org.openecomp.sdc.itempermissions.ItemPermissionsManager; -import org.openecomp.sdc.itempermissions.ItemPermissionsManagerFactory; +import org.openecomp.sdc.itempermissions.PermissionsManager; +import org.openecomp.sdc.itempermissions.PermissionsManagerFactory; import org.openecomp.sdcrests.itempermissions.rest.ItemPermissions; import org.openecomp.sdcrests.itempermissions.rest.mapping.MapItemPermissionsToItemPermissionsDto; import org.openecomp.sdcrests.itempermissions.types.ItemPermissionsDto; @@ -24,8 +38,8 @@ import javax.ws.rs.core.Response; @Scope(value = "prototype") public class ItemPermissionsImpl implements ItemPermissions { - private ItemPermissionsManager itemPermissionsManager = - ItemPermissionsManagerFactory.getInstance().createInterface(); + private PermissionsManager permissionsManager = + PermissionsManagerFactory.getInstance().createInterface(); @Override public Response list(String itemId, String user) { @@ -33,7 +47,7 @@ public class ItemPermissionsImpl implements ItemPermissions { GenericCollectionWrapper results = new GenericCollectionWrapper<>(); MapItemPermissionsToItemPermissionsDto mapper = new MapItemPermissionsToItemPermissionsDto(); - itemPermissionsManager.listItemPermissions(itemId) + permissionsManager.listItemPermissions(itemId) .forEach(itemPermission -> results.add(mapper.applyMapping (itemPermission, ItemPermissionsDto.class))); @@ -44,7 +58,7 @@ public class ItemPermissionsImpl implements ItemPermissions { public Response updatePermissions(ItemPermissionsRequestDto request, String itemId, String permission, String user) { - itemPermissionsManager.updateItemPermissions(itemId,permission,request.getAddedUsersIds(), + permissionsManager.updateItemPermissions(itemId,permission,request.getAddedUsersIds(), request.getRemovedUsersIds()); return Response.ok().build(); -- cgit 1.2.3-korg