From user-return-21806-apmail-couchdb-user-archive=couchdb.apache.org@couchdb.apache.org Fri Aug 17 08:04:58 2012 Return-Path: X-Original-To: apmail-couchdb-user-archive@www.apache.org Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 93775DB15 for ; Fri, 17 Aug 2012 08:04:58 +0000 (UTC) Received: (qmail 57132 invoked by uid 500); 17 Aug 2012 08:04:57 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 57030 invoked by uid 500); 17 Aug 2012 08:04:56 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 57009 invoked by uid 99); 17 Aug 2012 08:04:56 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 17 Aug 2012 08:04:56 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FSL_RCVD_USER,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of dave@muse.net.nz designates 209.85.160.52 as permitted sender) Received: from [209.85.160.52] (HELO mail-pb0-f52.google.com) (209.85.160.52) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 17 Aug 2012 08:04:50 +0000 Received: by pbcxa7 with SMTP id xa7so3135406pbc.11 for ; Fri, 17 Aug 2012 01:04:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=muse.net.nz; s=google; h=mime-version:x-originating-ip:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=WWQ37dEAGDe79fHOc3Z2SFoYNIFq9+frYCoOX7WMDbo=; b=mKFr5hNfNiuv14pqpDnjbvJnp7JBMttBnJt4EinZk+rolIA3OTw1g6Z2EvUhC8FWJK /gd63ffOE+YCe6Ga/kGiRIyFDl2kDJj+0Mm1VeCVwjqd3h2efXr/VoLuwy5daY0zYrmG recz+bBnS3X9gBVGw9VGuAj+IGJMgNmnQI72Q= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-originating-ip:in-reply-to:references:date :message-id:subject:from:to:content-type:x-gm-message-state; bh=WWQ37dEAGDe79fHOc3Z2SFoYNIFq9+frYCoOX7WMDbo=; b=fI+R15DzgDh8IgzvS2f+s6KX4BhQ5R6A3uxwyO61bNqBDnbZGJk8AF8xXbMulNG1y3 ycZ3KcuiZQk2iT74l99ckY0sEQLIKHGXWPF12qc4HSluss1ZcMrBD3MZGtObJpdw4DQf flfJXfViiJJ0RiWlbA8y+3l57RE06OEZLLG6UT4Az8y9/bXNef6AVALSzmCfMEH6KPxI /anbaXE9pFoGe2OxQcpAX1eD16040KIP1kZIZjdP8XshbFSKrWsMSDqbSAlAucm+XEe9 J1n7w7K70HvMBXjLDt/2EBBnrr/dN1NBkDkNhM9ygcanleTdtcD2TYKvlSYlrKw6YMbL wAiQ== MIME-Version: 1.0 Received: by 10.68.195.106 with SMTP id id10mr9435938pbc.121.1345190669713; Fri, 17 Aug 2012 01:04:29 -0700 (PDT) Received: by 10.68.223.6 with HTTP; Fri, 17 Aug 2012 01:04:29 -0700 (PDT) X-Originating-IP: [84.112.19.176] In-Reply-To: References: Date: Fri, 17 Aug 2012 10:04:29 +0200 Message-ID: Subject: Re: How do non-admin users get roles in a couchapp? From: Dave Cottlehuber To: user@couchdb.apache.org Content-Type: text/plain; charset=ISO-8859-1 X-Gm-Message-State: ALoCoQlR9ers58GhFzpQyEQ5tWJhnWmMF1tSgvbXyAgP6/G5ZZL1/iHdz1yQuUNJ+QeMqBxu91Nl X-Virus-Checked: Checked by ClamAV on apache.org On 17 August 2012 09:58, Dave Cottlehuber wrote: Oops, lost some text there. > I'd be interested to see what other options are proposed for this, but > I'd use the changes feed on _users while connected as an admin. This > seems the most sensible to me: > > GET /_users/_changes?feed=continuous&since=3&include_docs=true HTTP/1.1 > I'd likely do this as an external handler so couchdb ensures that it's > always running when CouchDB is: > > http://couchdb.readthedocs.org/en/latest/1.1/other.html?highlight=os_daemons > & some more details http://davispj.com/2010/09/26/new-couchdb-externals-api.html You'd probably want to include a filter to catch only users with an empty doc.roles and then subscribe them using some rules to the appropriate database roles. A+ Dave