You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by rn...@apache.org on 2017/07/12 21:06:29 UTC
[couchdb] branch master updated: fix whitespace crimes
This is an automated email from the ASF dual-hosted git repository.
rnewson pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/couchdb.git
The following commit(s) were added to refs/heads/master by this push:
new 1deeac0 fix whitespace crimes
1deeac0 is described below
commit 1deeac0adbc39546d7061ab2cb6847cb425f615b
Author: Robert Newson <rn...@apache.org>
AuthorDate: Wed Jul 12 22:06:12 2017 +0100
fix whitespace crimes
---
src/chttpd/src/chttpd_auth_request.erl | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/chttpd/src/chttpd_auth_request.erl b/src/chttpd/src/chttpd_auth_request.erl
index 319e70b..4e2e0db 100644
--- a/src/chttpd/src/chttpd_auth_request.erl
+++ b/src/chttpd/src/chttpd_auth_request.erl
@@ -97,14 +97,14 @@ require_admin(Req) ->
require_db_admin(#httpd{path_parts=[DbName|_],user_ctx=Ctx}=Req) ->
Sec = fabric:get_security(DbName, [{user_ctx, Ctx}]),
-
+
case is_db_admin(Ctx,Sec) of
true -> Req;
false -> throw({unauthorized, <<"You are not a server or db admin.">>})
end.
is_db_admin(#user_ctx{name=UserName,roles=UserRoles}, {Security}) ->
- {Admins} = couch_util:get_value(<<"admins">>, Security, {[]}),
+ {Admins} = couch_util:get_value(<<"admins">>, Security, {[]}),
Names = couch_util:get_value(<<"names">>, Admins, []),
Roles = couch_util:get_value(<<"roles">>, Admins, []),
case check_security(roles, UserRoles, [<<"_admin">> | Roles]) of
@@ -123,4 +123,4 @@ check_security(names, _, []) ->
check_security(names, null, _) ->
false;
check_security(names, UserName, Names) ->
- lists:member(UserName, Names).
\ No newline at end of file
+ lists:member(UserName, Names).
--
To stop receiving notification emails like this one, please contact
['"commits@couchdb.apache.org" <co...@couchdb.apache.org>'].