diff options
author | 2021-03-22 15:33:06 +0000 | |
---|---|---|
committer | 2021-03-24 06:59:47 +0000 | |
commit | d378c37fbd1ecec7b43394926f1ca32a695e07de (patch) | |
tree | 5c8a085f8732f980d871d966ac49361644efa698 /openecomp-be/api/openecomp-sdc-rest-webapp/item-permissions-rest/item-permissions-rest-services/src/main/java/org/openecomp/sdcrests/itempermissions/rest/services | |
parent | a6ae7294ecd336d7e88f915710b08e2658eaee00 (diff) |
Reformat openecomp-be
Signed-off-by: Vasyl Razinkov <vasyl.razinkov@est.tech>
Issue-ID: SDC-3449
Change-Id: I13e02322f8e00820cc5a1d85752caaeda9bf10d1
Diffstat (limited to 'openecomp-be/api/openecomp-sdc-rest-webapp/item-permissions-rest/item-permissions-rest-services/src/main/java/org/openecomp/sdcrests/itempermissions/rest/services')
-rw-r--r-- | 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 | 48 |
1 files changed, 18 insertions, 30 deletions
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 213af650f7..ece235a29a 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 @@ -15,7 +15,8 @@ */ package org.openecomp.sdcrests.itempermissions.rest.services; - +import javax.inject.Named; +import javax.ws.rs.core.Response; import org.openecomp.sdc.itempermissions.PermissionsManager; import org.openecomp.sdc.itempermissions.PermissionsManagerFactory; import org.openecomp.sdcrests.itempermissions.rest.ItemPermissions; @@ -26,41 +27,28 @@ import org.openecomp.sdcrests.wrappers.GenericCollectionWrapper; import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Service; -import javax.inject.Named; -import javax.ws.rs.core.Response; - /** * Created by ayalaben on 6/18/2017. */ - @Named @Service("itemPermissions") @Scope(value = "prototype") public class ItemPermissionsImpl implements ItemPermissions { - private PermissionsManager permissionsManager = - PermissionsManagerFactory.getInstance().createInterface(); - - @Override - public Response list(String itemId, String user) { - - GenericCollectionWrapper<ItemPermissionsDto> results = new GenericCollectionWrapper<>(); - MapItemPermissionsToItemPermissionsDto mapper = new MapItemPermissionsToItemPermissionsDto(); - - permissionsManager.listItemPermissions(itemId) - .forEach(itemPermission -> results.add(mapper.applyMapping - (itemPermission, ItemPermissionsDto.class))); - - return Response.ok(results).build(); - } - - @Override - public Response updatePermissions(ItemPermissionsRequestDto request, String itemId, - String permission, String user) { - - permissionsManager.updateItemPermissions(itemId,permission,request.getAddedUsersIds(), - request.getRemovedUsersIds()); - - return Response.ok().build(); - } + private PermissionsManager permissionsManager = PermissionsManagerFactory.getInstance().createInterface(); + + @Override + public Response list(String itemId, String user) { + GenericCollectionWrapper<ItemPermissionsDto> results = new GenericCollectionWrapper<>(); + MapItemPermissionsToItemPermissionsDto mapper = new MapItemPermissionsToItemPermissionsDto(); + permissionsManager.listItemPermissions(itemId) + .forEach(itemPermission -> results.add(mapper.applyMapping(itemPermission, ItemPermissionsDto.class))); + return Response.ok(results).build(); + } + + @Override + public Response updatePermissions(ItemPermissionsRequestDto request, String itemId, String permission, String user) { + permissionsManager.updateItemPermissions(itemId, permission, request.getAddedUsersIds(), request.getRemovedUsersIds()); + return Response.ok().build(); + } } |