Sync Gateway remove access


#1

Hello,

In Sync Gateway, It’s possible to remove the access permission to channels that previously has been added by access (“user”, “channel”); ?

Thanks.


#2

I have the same question.


#3

A new revision of the doc that previously granted access can reverse that permission.

For example - if you’re granting access based on an ‘owner’ property in the document, with something like this in your sync function:

if (doc.owner) {
  access(doc.owner, 'somechannel')
}

A new revision of the document that modifies the owner property will mean this document no longer grants the previous doc.owner access to somechannel.


#4

Hi,

Does removing the document have the same effect ?

Regards.


#5

If a document is deleted through the SG API, it will generate a deleted (tombstone) revision, which works in a similar fashion.