2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
21 package org.openecomp.sdcrests.itempermissions.rest;
24 import io.swagger.annotations.Api;
25 import io.swagger.annotations.ApiOperation;
26 import org.openecomp.sdcrests.itempermissions.types.ItemPermissionsDto;
27 import org.openecomp.sdcrests.itempermissions.types.ItemPermissionsRequestDto;
28 import org.springframework.validation.annotation.Validated;
30 import javax.validation.Valid;
31 import javax.validation.constraints.NotNull;
33 import javax.ws.rs.core.MediaType;
34 import javax.ws.rs.core.Response;
36 import static org.openecomp.sdcrests.common.RestConstants.USER_ID_HEADER_PARAM;
37 import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG;
40 * Created by ayalaben on 6/18/2017.
42 @Path("/v1.0/items/{itemId}/permissions")
43 @Produces(MediaType.APPLICATION_JSON)
44 @Consumes(MediaType.APPLICATION_JSON)
45 @Api(value = "Item Permissions")
47 public interface ItemPermissions {
51 @ApiOperation(value = "List users permissions assigned on item",
52 response = ItemPermissionsDto.class,
53 responseContainer = "List")
55 Response list(@PathParam("itemId") String itemId,
56 @HeaderParam(USER_ID_HEADER_PARAM) String user);
59 @Path("/{permission}")
60 @ApiOperation(value = "Update useres permission on item")
61 Response updatePermissions(@Valid ItemPermissionsRequestDto request,
62 @PathParam("itemId") String itemId,
63 @PathParam("permission") String permission,
64 @NotNull(message = USER_MISSING_ERROR_MSG)
65 @HeaderParam(USER_ID_HEADER_PARAM) String user);