couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chewbra...@apache.org
Subject [1/4] couchdb-cassim git commit: Add enable cassim feature flag
Date Tue, 21 Jul 2015 20:48:09 GMT
Repository: couchdb-cassim
Updated Branches:
  refs/heads/master c6581f8e8 -> 552f480fb


Add enable cassim feature flag


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

Branch: refs/heads/master
Commit: e2ad37a59040e593223bd426b1769a95368ca369
Parents: c6581f8
Author: Russell Branca <chewbranca@apache.org>
Authored: Fri Jun 26 22:15:08 2015 +0000
Committer: Russell Branca <chewbranca@apache.org>
Committed: Tue Jul 21 20:45:35 2015 +0000

----------------------------------------------------------------------
 src/cassim.erl          | 12 +++++++++++-
 src/cassim_security.erl |  2 +-
 2 files changed, 12 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-cassim/blob/e2ad37a5/src/cassim.erl
----------------------------------------------------------------------
diff --git a/src/cassim.erl b/src/cassim.erl
index e838c53..3af0096 100644
--- a/src/cassim.erl
+++ b/src/cassim.erl
@@ -14,7 +14,9 @@
 
 
 -export([
-    is_enabled/0
+    is_enabled/0,
+    is_active/0,
+    metadata_db_exists/0
 ]).
 
 -export([
@@ -39,7 +41,15 @@
 -include_lib("couch/include/couch_db.hrl").
 
 
+is_active() ->
+    is_enabled() andalso metadata_db_exists().
+
+
 is_enabled() ->
+    config:get_boolean("cassim", "enable", false).
+
+
+metadata_db_exists() ->
     cassim_metadata_cache:metadata_db_exists().
 
 

http://git-wip-us.apache.org/repos/asf/couchdb-cassim/blob/e2ad37a5/src/cassim_security.erl
----------------------------------------------------------------------
diff --git a/src/cassim_security.erl b/src/cassim_security.erl
index e436f32..b9e5e0f 100644
--- a/src/cassim_security.erl
+++ b/src/cassim_security.erl
@@ -41,7 +41,7 @@ get_security(DbName) ->
 get_security(#db{name=DbName}, Options) ->
     get_security(DbName, Options);
 get_security(DbName, Options) ->
-    case cassim:is_enabled() of
+    case cassim:is_active() of
         true ->
             UserCtx = couch_util:get_value(user_ctx, Options, #user_ctx{}),
             Doc = get_security_doc(DbName),


Mime
View raw message