There is only a single instance of the Server class. You would have to restrict the data you send per request. You would use the same mechanism as the current
--virtual-library
option to the server, except that the virtual library to use would now need to be gotten based on the authenticated user per request. There are various caching mechanisms in the server to speed up --virtual-library, which might have to be generalized as well. The database API is perfectly capable of returning data for different restrictions in the same isntance.
On a general note, calibre's content server is really designed to be a personal server not one for distribution to multiple parties. So while I wont refuse this functionality, it has to be implemented in a way that does not compromise the core use case.
|