Hello,

I'm working on a multi-user application where groups of users will have
access to shared databases.

For instance, users A, B and C might have access to database X, while users
A, C and D might have access to database X and Y and users E and F might
have access to database Z.

In  this system, our goal is that users having access to a specific
database can mention other users (also having access to the same database)
at multiple locations in the application.

So for instance, if user A is creating a document in database X, then I
want him to be able to mention users B and/or C within that document.

Considering that this is an offline-first application, I need users to have
access to a subset of the user information while offline, so that they can
continue to create/alter documents while offline and still be able to
mention those other users.

I'm using CouchDB on the back-end and PouchDB on the front-end.
All users of the system are stored in _users.

At first I thought about implementing a sort of filtered replication of
_users to the clients so that they could have a local copy of the set of
users that they might need to interact with (e.g., user A would need to
have a subset of the information of users B, C and D locally so that he can
mention them, but should not have any information about users E and F).

I also through about copying the user information subset in each database,
depending on who's a member, but that means additional logic upon each user
modification..

Is this doable in some way using only Couch or should I introduce a
middle-man between Couch and pouch to handle this access and the filtering?

Do you have other ideas for me to do something like this?

kr,
Sébastien

Reply via email to