janl commented on code in PR #4673:
URL: https://github.com/apache/couchdb/pull/4673#discussion_r1296837073


##########
src/chttpd/src/chttpd_db.erl:
##########
@@ -1967,6 +1972,21 @@ parse_shards_opt("placement", Req, Default) ->
                     throw({bad_request, Err})
             end
     end;
+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 Value =:= true ->
+    case config:get_boolean("per_doc_access", "enabled", false) of
+        true ->
+            true;
+        false ->
+            Err = ?l2b(["The `access` option is not available on this CouchDB 
installation."]),

Review Comment:
   I couldn’t find a nice way to do the binary construction with a parameter 
further down and I opted to make all `Err` constructions looks the same. I’ll 
remove the runtime conversion where easily possible



##########
src/chttpd/src/chttpd_db.erl:
##########
@@ -1967,6 +1972,21 @@ parse_shards_opt("placement", Req, Default) ->
                     throw({bad_request, Err})
             end
     end;
+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 Value =:= true ->
+    case config:get_boolean("per_doc_access", "enabled", false) of
+        true ->
+            true;
+        false ->
+            Err = ?l2b(["The `access` option is not available on this CouchDB 
installation."]),

Review Comment:
   I couldn’t find a nice way to do the binary construction with a parameter 
further down and I opted to make all `Err` constructions looks the same. I’ll 
remove the runtime conversion where easily possible



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to