class RepositoryPermissionsJaxrsService {

    @PUT
    @Path("/{uri:.+}")
    @Consumes({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
    @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
    public Response updatePermission(RepositoryPermission permission,
            @Context UriInfo uriInfo) throws ErrorDescriptorException {

        PermissionComplexKey permissionComplexKey = new PermissionComplexKey(uriInfo).invoke();
        permission.setUri(permissionComplexKey.getResourceUri());
        permission.setRecipient(permissionComplexKey.getRecipientUri());

        service.putPermission(converter.toServer(permission, null));

        return Response.ok().entity(permission).build();
    }

}