From ee8a76e1cad33831448dbf12a394c51aa65230f4 Mon Sep 17 00:00:00 2001 From: John Christopher Anderson Date: Mon, 1 Feb 2010 22:51:15 +0000 Subject: Database-level security. This patch builds on the DB-admins feature to store lists of database admin and reader names and roles, as well as a security object which can be used for configuration in validation functions. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@905436 13f79535-47bb-0310-9956-ffa450edef68 --- share/www/script/futon.browse.js | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'share/www/script/futon.browse.js') diff --git a/share/www/script/futon.browse.js b/share/www/script/futon.browse.js index 31e979bb..ade16b20 100644 --- a/share/www/script/futon.browse.js +++ b/share/www/script/futon.browse.js @@ -178,6 +178,32 @@ } }); } + + this.databaseSecurity = function() { + $.showDialog("dialog/_database_security.html", { + load : function(d) { + ["admin", "reader"].forEach(function(key) { + db.getDbProperty("_"+key+"s", { + success : function(r) { + $("input[name="+key+"_names]",d).val(JSON.stringify(r.names||[])); + $("input[name="+key+"_roles]",d).val(JSON.stringify(r.roles||[])); + } + }); + }); + }, + // maybe this should be 2 forms + submit: function(data, callback) { + ["admin", "reader"].forEach(function(key) { + var new_value = { + names : JSON.parse(data[key+"_names"]), + roles : JSON.parse(data[key+"_roles"]) + }; + db.setDbProperty("_"+key+"s", new_value); + }); + callback(); + } + }); + } this.populateViewEditor = function() { if (viewName.match(/^_design\//)) { -- cgit v1.2.3