Skip to content
Browse files

Refactor to use lib.normalize_security()

  • Loading branch information...
1 parent 82cdc25 commit a75d3628fa022d9af12c8ccd9e1876fc86c5afe8 @jhs committed Feb 22, 2011
Showing with 1 addition and 7 deletions.
  1. +1 −7 audit_couchdb.js
View
8 audit_couchdb.js
@@ -47,13 +47,7 @@ function CouchAudit(url) {
// Return an array of reasons why this session would be granted access to a given database's _security object.
helpers.access_to = function enumerate_permissions(security, perm_test) {
- security = JSON.parse(JSON.stringify(security));
- security.admins = security.admins || {};
- security.admins.names = security.admins.names || [];
- security.admins.roles = security.admins.roles || [];
- security.readers = security.readers || {};
- security.readers.names = security.readers.names || [];
- security.readers.roles = security.readers.roles || [];
+ security = lib.normalize_security(security);
var rights = [];
var right_tests = {sys_admin: false, admin:false, reader:false};

0 comments on commit a75d362

Please sign in to comment.
Something went wrong with that request. Please try again.