Document access control (authorization) in multiple android devices (authorization,encryption)

Is it possible to restrict a document access in synced mobile devices?

My use case: there are several mobile users that live in an area without internet access. I am creating an app for them to gather some data, that uses couchbase lite. The users in this community will sync the data between their devices.

Eventually, one of the users will go to an area with internet access and upload all community data to a sync gateway, also receive some data that will be shared back with the community.

It would be important that each user’s data only be open to read by himself/herself and by the admin in the couchbase server. In the devices of other users in the community, the user data should be encrypted.

Does couchbase implement any feature to do this access control? For instance, document encryption, or other?

We do not have end-to-end document or per property encryption / decryption for replication in CBL Android. However, in CBL-C, 3.0.2, we do have the end-to-end property encryption / decryption feature that could help you implement the feature.

For the current CBL Android, you will need to implement the feature in the app yourself such as always encrypting the properties that are sensitive and decrypting them when reading the properties. One of the drawbacks of this approach is that the encrypted properties cannot be used as condition in queries.