This is an automated email from the ASF dual-hosted git repository.

jan pushed a commit to branch rebase/access-2023
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit c45a7f02b1fdd448a0d7725c2a69f0be713a6881
Author: Jan Lehnardt <[email protected]>
AuthorDate: Sat Aug 6 16:30:30 2022 +0200

    fix(access): opt-out switch
---
 src/chttpd/src/chttpd_db.erl | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/chttpd/src/chttpd_db.erl b/src/chttpd/src/chttpd_db.erl
index 7b12719b5..74a0bd3a1 100644
--- a/src/chttpd/src/chttpd_db.erl
+++ b/src/chttpd/src/chttpd_db.erl
@@ -1976,13 +1976,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});

Reply via email to