summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Lehnardt <jan@apache.org>2022-08-06 16:30:30 +0200
committerJan Lehnardt <jan@apache.org>2022-12-16 16:56:18 +0100
commitb6a7521147f053bd725279d03a3309b046309c53 (patch)
treeeb004921e49de75811c5b66894094b18f371495a
parent92f36af80e4c3d21713ea7519053bf56ccdf5740 (diff)
downloadcouchdb-b6a7521147f053bd725279d03a3309b046309c53.tar.gz
fix(access): opt-out switch
-rw-r--r--src/chttpd/src/chttpd_db.erl8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/chttpd/src/chttpd_db.erl b/src/chttpd/src/chttpd_db.erl
index f46847b3c..24ef1d0b9 100644
--- a/src/chttpd/src/chttpd_db.erl
+++ b/src/chttpd/src/chttpd_db.erl
@@ -2005,13 +2005,15 @@ parse_shards_opt("placement", Req, Default) ->
parse_shards_opt("access", Req, Value) when is_list(Value) ->
parse_shards_opt("access", Req, list_to_existing_atom(Value));
-parse_shards_opt("access", _Req, Value) when is_boolean(Value) ->
+parse_shards_opt("access", _Req, Value) when Value =:= true ->
case config:get_boolean("per_doc_access", "enabled", false) of
- true -> Value;
+ true -> true;
false ->
- Err = ?l2b(["The `access` is not available on this CouchDB installation."]),
+ Err = ?l2b(["The `access` option is not available on this CouchDB installation."]),
throw({bad_request, Err})
end;
+parse_shards_opt("access", _Req, Value) when Value =:= false ->
+ false;
parse_shards_opt("access", _Req, _Value) ->
Err = ?l2b(["The `access` value should be a boolean."]),
throw({bad_request, Err});