Libki / libki-server

Libki Server
Other
55 stars 28 forks source link

Multiple branch support #306

Open jfmartinezm opened 1 year ago

jfmartinezm commented 1 year ago

Sometimes libraries that belong to the same library network (branches located on different buildings) could benefit from sharing the same Libki server, but would still need to have access only to their own assets (clients, printjobs, etc).

One way to achieve that is by using the multi-tenant capabilities of Libki, but as I see on #232 that feature is troublesome and is probably going to be removed. Besides, the branches are not really different tenants, as they belong to the same network. Another solution would be to use completely separated Libki instances for each of the branches, but that would mean running and maintaining different servers/containers and multiple database instances (or multiple databases, at least). Extracting information for that separated databases (e.g. statistics for the whole network) would be more complicated then.

Perhaps there could be some way of filtering the items (clients, printjobs, etc) for admin users, so that they only get access to items on certain locations, or named following a certain pattern.

kylemhall commented 1 year ago

Multi-building support is in the planning stages. The plan is to either modify the instance column such that it's no longer a hidden field, but just a "parent location", or to remove it and add a 'sub-location' column.

jfmartinezm commented 1 year ago

Ok, so in that case filtering would be done depending on an additional field, either the old instance field repurposed as parent location, or a new sub-location field. I guess in any of that cases, the parent or sub-location would have to be added to the client settings just as it happens with the current location field.

I was thinking about using the current location field to specify that parent or sub location: instead of it being a single, flat value (like "Floor 2"), it could be used as a hierarchical value (like "Main Branch.Floor 2", or even "Main Branch.Floor 2.Guest area", etc. Then, admin users would have a "location filter" field that would filter the items they can see: "Main Branch.*" for whole branch admins, "Main Branch.Floor 2.*" for Floor 2 staff, etc. Superadmins could have "*" as a filter so they have access to all entries.

What do you think? How hard would it be to implement a scheme like that?