You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by Ryan Ramage <ry...@gmail.com> on 2011/02/27 18:38:25 UTC

Detecting changes to admins/readers on a DB

Hi all,

Just wondering if there is a way to listen to (like a changes feed)
for the security object on a db.
I will have a server full of dbs and I want to be able to know when a
user has been added (or removed) from a db security object so I can
send them
an email.

A side question would be a query to find all the dbs a user has
permissions on. I can brute force it by getting each security object
on all dbs, but is there a single query?

Cheers

Ryan

Re: Detecting changes to admins/readers on a DB

Posted by "Johannes J. Schmidt" <sc...@netzmerk.com>.
Am Sonntag, den 27.02.2011, 10:38 -0700 schrieb Ryan Ramage:
> I will have a server full of dbs and I want to be able to know when a
> user has been added (or removed) from a db security object so I can
> send them
> an email.
I came up with the following solution for that purpose:

1. create a document in a writable database (per user or global) with a
field "status": "new", and information about the user and database.
2. make the change to the security object
3. change the status field to "done"

That way you can (implicitly) listen for changes to the security
objects.

Greetings
Johannes

Re: Detecting changes to admins/readers on a DB

Posted by Robert Newson <ro...@gmail.com>.
No, it won't, updates to the /db/_security resource don't appear in
changes feed nor does it send a notification on update.

B.

On 27 February 2011 13:41, Ryan Ramage <ry...@gmail.com> wrote:
> Its not so much about a new user....but a changes to each db security
> object that I want to detect.
>
>
> Will the /_users/_changes feed emit changes when someone does a put to
> put to /test/_security ?
>
> On Sun, Feb 27, 2011 at 11:34 AM, Robert Newson <ro...@gmail.com> wrote:
>> The _users db has a changes feed (/_users/_changes), does that help? :)
>>
>> B.
>>
>> On 27 February 2011 12:38, Ryan Ramage <ry...@gmail.com> wrote:
>>> Hi all,
>>>
>>> Just wondering if there is a way to listen to (like a changes feed)
>>> for the security object on a db.
>>> I will have a server full of dbs and I want to be able to know when a
>>> user has been added (or removed) from a db security object so I can
>>> send them
>>> an email.
>>>
>>> A side question would be a query to find all the dbs a user has
>>> permissions on. I can brute force it by getting each security object
>>> on all dbs, but is there a single query?
>>>
>>> Cheers
>>>
>>> Ryan
>>>
>>
>

Re: Detecting changes to admins/readers on a DB

Posted by Ryan Ramage <ry...@gmail.com>.
Its not so much about a new user....but a changes to each db security
object that I want to detect.


Will the /_users/_changes feed emit changes when someone does a put to
put to /test/_security ?

On Sun, Feb 27, 2011 at 11:34 AM, Robert Newson <ro...@gmail.com> wrote:
> The _users db has a changes feed (/_users/_changes), does that help? :)
>
> B.
>
> On 27 February 2011 12:38, Ryan Ramage <ry...@gmail.com> wrote:
>> Hi all,
>>
>> Just wondering if there is a way to listen to (like a changes feed)
>> for the security object on a db.
>> I will have a server full of dbs and I want to be able to know when a
>> user has been added (or removed) from a db security object so I can
>> send them
>> an email.
>>
>> A side question would be a query to find all the dbs a user has
>> permissions on. I can brute force it by getting each security object
>> on all dbs, but is there a single query?
>>
>> Cheers
>>
>> Ryan
>>
>

Re: Detecting changes to admins/readers on a DB

Posted by Robert Newson <ro...@gmail.com>.
The _users db has a changes feed (/_users/_changes), does that help? :)

B.

On 27 February 2011 12:38, Ryan Ramage <ry...@gmail.com> wrote:
> Hi all,
>
> Just wondering if there is a way to listen to (like a changes feed)
> for the security object on a db.
> I will have a server full of dbs and I want to be able to know when a
> user has been added (or removed) from a db security object so I can
> send them
> an email.
>
> A side question would be a query to find all the dbs a user has
> permissions on. I can brute force it by getting each security object
> on all dbs, but is there a single query?
>
> Cheers
>
> Ryan
>