Permalink
Browse files

Warn if a connection is not _admin

  • Loading branch information...
1 parent f10c21b commit 82cdc25ec73882d50bdc47e051ab22f5e7747c26 @jhs committed Feb 22, 2011
Showing with 6 additions and 0 deletions.
  1. +6 −0 probe_couchdb.js
View
@@ -72,6 +72,12 @@ function Couch(url) {
})
})
+ self.on('session', function(session) {
+ if(session.userCtx.roles.indexOf('_admin') === -1)
+ self.log.warn("Results will be incomplete without _admin access");
+ var roles = (session.userCtx || {}).roles || [];
+ })
+
self.on('db_name', function(db_name) {
var db_url = lib.join(self.url, encodeURIComponent(db_name))
, sec_url = lib.join(db_url, '/_security')

0 comments on commit 82cdc25

Please sign in to comment.