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


##########
src/couch/src/couch_httpd_auth.erl:
##########
@@ -99,6 +99,13 @@ basic_name_pw(Req) ->
             nil
     end.
 
+extract_roles(UserProps) ->
+    Roles = couch_util:get_value(<<"roles">>, UserProps, []),
+    case lists:member(<<"_admin">>, Roles) of
+        true -> Roles;
+        _ -> [<<"_users">> | Roles]

Review Comment:
   @rnewson I switched to this from `Roles ++ <<"_users">>` by your request, 
but this prepends the new role to the list. I’d rather append it as not to 
break any existing scripts (I had to update a few tests to match for this 
change already). Would you be okay going back to `++` or is there a better 
option?



-- 
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