cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alek...@apache.org
Subject git commit: Allow non-schema system ks modification for shuffle to work; patch by Jouni Hartikainen, reviewed by Aleksey Yeschenko for CASSANDRA-5097
Date Wed, 02 Jan 2013 18:08:19 GMT
Updated Branches:
  refs/heads/cassandra-1.2 db2eccbfc -> b8d88023a


Allow non-schema system ks modification for shuffle to work;
patch by Jouni Hartikainen, reviewed by Aleksey Yeschenko for
CASSANDRA-5097


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

Branch: refs/heads/cassandra-1.2
Commit: b8d88023a7e91790665c272c6b7b6cd5aa13e7e4
Parents: db2eccb
Author: Aleksey Yeschenko <aleksey@apache.org>
Authored: Wed Jan 2 21:06:12 2013 +0300
Committer: Aleksey Yeschenko <aleksey@apache.org>
Committed: Wed Jan 2 21:06:12 2013 +0300

----------------------------------------------------------------------
 CHANGES.txt                                        |    1 +
 .../org/apache/cassandra/service/ClientState.java  |    6 +++---
 2 files changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/b8d88023/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index cc9b145..761b68d 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -16,6 +16,7 @@
  * Log compaction merge counts (CASSANDRA-4894)
  * Minimize byte array allocation by AbstractData{Input,Output} (CASSANDRA-5090)
  * Add SSL support for the binary protocol (CASSANDRA-5031)
+ * Allow non-schema system ks modification for shuffle to work (CASSANDRA-5097)
 
 
 1.2.0

http://git-wip-us.apache.org/repos/asf/cassandra/blob/b8d88023/src/java/org/apache/cassandra/service/ClientState.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/service/ClientState.java b/src/java/org/apache/cassandra/service/ClientState.java
index 06c752f..d0cf0ba 100644
--- a/src/java/org/apache/cassandra/service/ClientState.java
+++ b/src/java/org/apache/cassandra/service/ClientState.java
@@ -143,7 +143,7 @@ public class ClientState
         if (internalCall)
             return;
         validateLogin();
-        preventSystemKSSModification(keyspace, perm);
+        preventSystemKSSchemaModification(keyspace, perm);
         if (perm.equals(Permission.SELECT) && READABLE_SYSTEM_RESOURCES.contains(resource))
             return;
         if (PROTECTED_AUTH_RESOURCES.contains(resource))
@@ -164,9 +164,9 @@ public class ClientState
                                                       resource));
     }
 
-    private void preventSystemKSSModification(String keyspace, Permission perm) throws UnauthorizedException
+    private void preventSystemKSSchemaModification(String keyspace, Permission perm) throws
UnauthorizedException
     {
-        if (Schema.systemKeyspaceNames.contains(keyspace.toLowerCase()) && !perm.equals(Permission.SELECT))
+        if (Schema.systemKeyspaceNames.contains(keyspace.toLowerCase()) && !(perm.equals(Permission.SELECT)
|| perm.equals(Permission.MODIFY)))
             throw new UnauthorizedException(keyspace + " keyspace is not user-modifiable.");
     }
 


Mime
View raw message