janl commented on code in PR #4673:
URL: https://github.com/apache/couchdb/pull/4673#discussion_r1285933876
##########
src/couch/src/couch_httpd_auth.erl:
##########
@@ -98,6 +98,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;
+ _ -> Roles ++ [<<"_users">>]
Review Comment:
we’ve been over. this before, I want to explicitly append the new role to
the array so any tests and code that expect their existing roles in the
beginning just keep working and you OK’d that reasoning on an older PR :)
##########
src/couch/src/couch_httpd_auth.erl:
##########
@@ -98,6 +98,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;
+ _ -> Roles ++ [<<"_users">>]
Review Comment:
we’ve been over. this before, I want to explicitly append the new role to
the array so any tests and code that expect their existing roles in the
beginning just keep working and you OK’d that reasoning on an older PR :)
--
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]