@POST
  @Produces(MediaType.TEXT_PLAIN)
  @ApiOperation(value = "Create view instance privilege")
  @ApiImplicitParams({
    @ApiImplicitParam(dataType = PRIVILEGE_INFO_REQUEST_TYPE, paramType = PARAM_TYPE_BODY)
  })
  @ApiResponses({
    @ApiResponse(code = HttpStatus.SC_CREATED, message = MSG_SUCCESSFUL_OPERATION),
    @ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = MSG_INVALID_ARGUMENTS),
    @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = MSG_NOT_AUTHENTICATED),
    @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = MSG_SERVER_ERROR),
  })
  public Response createPrivilege(String body, @Context HttpHeaders headers, @Context UriInfo ui,
    @ApiParam(value = "view name") @PathParam("viewName") String viewName,
    @ApiParam(value = "view version") @PathParam("version") String version,
    @ApiParam(value = "instance name") @PathParam("instanceName") String instanceName) {
    return handleRequest(headers, body, ui, Request.Type.POST,
        createPrivilegeResource(viewName, version, instanceName,null));
  }
Handles: POST /views/{viewName}/versions/{version}/instances/{instanceName}/privileges
Create a privilege.

@param body          request body
@param headers       http headers
@param ui            uri info
@param viewName      view id
@param version       version id
@param instanceName  instance id

@return information regarding the created privilege
ambari-server/src/main/java/org/apache/ambari/server/api/services/views/ViewPrivilegeService.java