summaryrefslogtreecommitdiff
path: root/share/www/script/futon.browse.js
diff options
context:
space:
mode:
authorJohn Christopher Anderson <jchris@apache.org>2010-02-01 22:51:15 +0000
committerJohn Christopher Anderson <jchris@apache.org>2010-02-01 22:51:15 +0000
commitee8a76e1cad33831448dbf12a394c51aa65230f4 (patch)
tree37e50fb2b43d4bb01b55fa8d1c05cda965b4dc4d /share/www/script/futon.browse.js
parent8c381ee8de4c43e84f937584a2b3cd5923602057 (diff)
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
Diffstat (limited to 'share/www/script/futon.browse.js')
-rw-r--r--share/www/script/futon.browse.js26
1 files changed, 26 insertions, 0 deletions
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\//)) {