couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rnew...@apache.org
Subject git commit: COUCHDB-1060 - fix _admin for both clauses
Date Mon, 26 Mar 2012 18:22:32 GMT
Updated Branches:
  refs/heads/master 40e8fe9d7 -> 10cddbe91


COUCHDB-1060 - fix _admin for both clauses


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/10cddbe9
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/10cddbe9
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/10cddbe9

Branch: refs/heads/master
Commit: 10cddbe91a6c93492b63f9fecf85009e8cda21b9
Parents: 40e8fe9
Author: Robert Newson <rnewson@apache.org>
Authored: Mon Mar 26 19:19:25 2012 +0100
Committer: Robert Newson <rnewson@apache.org>
Committed: Mon Mar 26 19:21:49 2012 +0100

----------------------------------------------------------------------
 src/couchdb/couch_auth_cache.erl |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/10cddbe9/src/couchdb/couch_auth_cache.erl
----------------------------------------------------------------------
diff --git a/src/couchdb/couch_auth_cache.erl b/src/couchdb/couch_auth_cache.erl
index 8d665f9..9fb778a 100644
--- a/src/couchdb/couch_auth_cache.erl
+++ b/src/couchdb/couch_auth_cache.erl
@@ -51,7 +51,7 @@ get_user_creds(UserName) ->
         nil ->
             make_admin_doc(HashedPwd, Salt, [<<"_admin">>]);
         UserProps when is_list(UserProps) ->
-            make_admin_doc(HashedPwd, Salt, [<<"_admin">>|couch_util:get_value(<<"roles">>,
UserProps)])
+            make_admin_doc(HashedPwd, Salt, couch_util:get_value(<<"roles">>,
UserProps))
         end;
     "-pbkdf2-" ++ HashedPwdSaltAndIterations ->
         [HashedPwd, Salt, Iterations] = string:tokens(HashedPwdSaltAndIterations, ","),
@@ -73,7 +73,7 @@ make_admin_doc(HashedPwd, Salt, Roles) ->
      {<<"password_sha">>, ?l2b(HashedPwd)}].
 
 make_admin_doc(DerivedKey, Salt, Iterations, Roles) ->
-    [{<<"roles">>, Roles},
+    [{<<"roles">>, [<<"_admin">>|Roles]},
      {<<"salt">>, ?l2b(Salt)},
      {<<"iterations">>, list_to_integer(Iterations)},
      {<<"password_scheme">>, <<"pbkdf2">>},


Mime
View raw message