summaryrefslogtreecommitdiff
path: root/src/couchdb/couch_js_functions.hrl
diff options
context:
space:
mode:
authorFilipe David Borba Manana <fdmanana@apache.org>2011-05-20 10:57:28 +0000
committerFilipe David Borba Manana <fdmanana@apache.org>2011-05-20 10:57:28 +0000
commit5b8d4522255662ce2b8637680ed1a3db24c2bcef (patch)
treeafbef88944f87abaaaad6775e1771f2fb055e685 /src/couchdb/couch_js_functions.hrl
parent4361a832c18be3f9d96e7943f6e1bbce92a94cad (diff)
Replication manager: allow edition of replication documents
Replication documents that are not in the triggered state can now be edited by users. This is to make it simpler for Futon users to restart replications - they can just edit the document, remove its state field, and save it, instead of recreating it or adding a similar document but with a different _id. This is a backport of revision 1125319 (trunk). git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.1.x@1125321 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/couchdb/couch_js_functions.hrl')
-rw-r--r--src/couchdb/couch_js_functions.hrl6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/couchdb/couch_js_functions.hrl b/src/couchdb/couch_js_functions.hrl
index 0cc49d62..1e3ed4e9 100644
--- a/src/couchdb/couch_js_functions.hrl
+++ b/src/couchdb/couch_js_functions.hrl
@@ -140,8 +140,10 @@
var isReplicator = (userCtx.roles.indexOf('_replicator') >= 0);
var isAdmin = (userCtx.roles.indexOf('_admin') >= 0);
- if (oldDoc && !newDoc._deleted && !isReplicator) {
- reportError('Only the replicator can edit replication documents.');
+ if (oldDoc && !newDoc._deleted && !isReplicator &&
+ (oldDoc._replication_state === 'triggered')) {
+ reportError('Only the replicator can edit replication documents ' +
+ 'that are in the triggered state.');
}
if (!newDoc._deleted) {