couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike Marino <mmar...@gmail.com>
Subject Re: CouchDB returning data filtered by userCtx.name
Date Fri, 20 Jun 2014 09:17:59 GMT
Hi Martin,

list functions give you access to the userCtx object and can allow you to
prepare the results of a view based upon a particular user.  See, e.g.

http://guide.couchdb.org/draft/transforming.html

However, you will still need to limit access to other pieces of the
database (using e.g. some sort of proxy request handler) since the user
will otherwise be able to read the rest of the database.

Perhaps another alternative would be to follow the one-user-per-database
model?  I don't have experience with this, but it has been discussed on the
list.

Cheers,
Mike


On Fri, Jun 20, 2014 at 11:04 AM, Gowtham Tamizharasan <
gowtham.tamizharasan@inmobi.com> wrote:

> Hi Martin,
>
> You could query a view function based on "key". so you can query like
> _view/myaccount?key="<user
> name>"
>
> In your View emit key as the user name.
>
>
>
> On Fri, Jun 20, 2014 at 12:02 PM, Martin Minka <martin.minka@gmail.com>
> wrote:
>
> > I am using CouchDB v1.4.0.
> >
> > Is followin doable in CouchDB ?
> > Client application will access CouchDB directly, client will authenticate
> > against CouchDB and request data from _view/myaccount, the data should be
> > filtered for userCtx.name.
> >
> > If user name has to be parameter for _view/myaccount is it possible to
> > validate it against userCtx.name ?
> >
> > Or do I have to use some other server level software to proxy requests
> > against CouchDB ?
> >
> > Thank you,
> > Martin
> >
>
> --
> _____________________________________________________________
> The information contained in this communication is intended solely for the
> use of the individual or entity to whom it is addressed and others
> authorized to receive it. It may contain confidential or legally privileged
> information. If you are not the intended recipient you are hereby notified
> that any disclosure, copying, distribution or taking any action in reliance
> on the contents of this information is strictly prohibited and may be
> unlawful. If you have received this communication in error, please notify
> us immediately by responding to this email and then delete it from your
> system. The firm is neither liable for the proper and complete transmission
> of the information contained in this communication nor for any delay in its
> receipt.
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message