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 2014/08/01 11:05:00 UTC
[7/9] git commit: Add cassim:is_enabled
Add cassim:is_enabled
BugzId: 32070
Project: http://git-wip-us.apache.org/repos/asf/couchdb-cassim/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-cassim/commit/80a17b00
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-cassim/tree/80a17b00
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-cassim/diff/80a17b00
Branch: refs/heads/windsor-merge
Commit: 80a17b0020b58a926713077cd26964a2375d59da
Parents: 1fe5777
Author: Russell Branca <ch...@apache.org>
Authored: Thu Jul 3 13:14:21 2014 -0700
Committer: Robert Newson <rn...@apache.org>
Committed: Wed Jul 30 18:18:25 2014 +0100
----------------------------------------------------------------------
src/cassim.erl | 8 ++++++++
src/cassim_security.erl | 2 +-
2 files changed, 9 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb-cassim/blob/80a17b00/src/cassim.erl
----------------------------------------------------------------------
diff --git a/src/cassim.erl b/src/cassim.erl
index b3debea..15b8570 100644
--- a/src/cassim.erl
+++ b/src/cassim.erl
@@ -16,6 +16,10 @@
-export([
+ is_enabled/0
+]).
+
+-export([
is_server_admin/1,
verify_is_admin/1,
verify_is_server_admin/1
@@ -37,6 +41,10 @@
-include_lib("couch/include/couch_db.hrl").
+is_enabled() ->
+ cassim_metadata_cache:metadata_db_exists().
+
+
verify_is_admin(#httpd{}=Req) ->
chttpd:verify_is_server_admin(Req).
http://git-wip-us.apache.org/repos/asf/couchdb-cassim/blob/80a17b00/src/cassim_security.erl
----------------------------------------------------------------------
diff --git a/src/cassim_security.erl b/src/cassim_security.erl
index daa9cfb..250ce9d 100644
--- a/src/cassim_security.erl
+++ b/src/cassim_security.erl
@@ -46,7 +46,7 @@ get_security(DbName) ->
get_security(#db{name=DbName}, Options) ->
get_security(DbName, Options);
get_security(DbName, Options) ->
- case cassim_metadata_cache:metadata_db_exists() of
+ case cassim:is_enabled() of
true ->
UserCtx = couch_util:get_value(user_ctx, Options, #user_ctx{}),
Doc = get_security_doc(DbName),