cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xe...@apache.org
Subject [1/2] git commit: merge from 1.1
Date Fri, 21 Sep 2012 10:08:42 GMT
Updated Branches:
  refs/heads/trunk ae91d17d3 -> 59a905c83


merge from 1.1


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

Branch: refs/heads/trunk
Commit: 59a905c8352a4836fb20d8505c3b03bb47a8a931
Parents: ae91d17 117d91a
Author: Pavel Yaskevich <xedin@apache.org>
Authored: Fri Sep 21 13:08:18 2012 +0300
Committer: Pavel Yaskevich <xedin@apache.org>
Committed: Fri Sep 21 13:08:18 2012 +0300

----------------------------------------------------------------------
 CHANGES.txt                                        |    1 +
 src/java/org/apache/cassandra/auth/Permission.java |    6 +++---
 .../org/apache/cassandra/service/ClientState.java  |   12 +++++++++---
 .../apache/cassandra/thrift/CassandraServer.java   |    2 +-
 4 files changed, 14 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/59a905c8/CHANGES.txt
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cassandra/blob/59a905c8/src/java/org/apache/cassandra/auth/Permission.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cassandra/blob/59a905c8/src/java/org/apache/cassandra/service/ClientState.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/service/ClientState.java
index d3bbc4e,279523f..51194d5
--- a/src/java/org/apache/cassandra/service/ClientState.java
+++ b/src/java/org/apache/cassandra/service/ClientState.java
@@@ -209,6 -170,12 +207,12 @@@ public class ClientStat
          hasAccess(user, perms, perm, resource);
      }
  
+     private void preventSystemKSModification(String keyspace, Permission perm) throws InvalidRequestException
+     {
 -        if (keyspace.equalsIgnoreCase(Table.SYSTEM_TABLE) && perm != Permission.SELECT
&& perm != Permission.DESCRIBE)
++        if (keyspace.equalsIgnoreCase(Table.SYSTEM_KS) && perm != Permission.SELECT
&& perm != Permission.DESCRIBE)
+             throw new InvalidRequestException("system keyspace is not user-modifiable.");
+     }
+ 
      /**
       * Confirms that the client thread has the given Permission in the context of the given
       * ColumnFamily and the current keyspace.

http://git-wip-us.apache.org/repos/asf/cassandra/blob/59a905c8/src/java/org/apache/cassandra/thrift/CassandraServer.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/thrift/CassandraServer.java
index b7815a6,a11472c..9b59519
--- a/src/java/org/apache/cassandra/thrift/CassandraServer.java
+++ b/src/java/org/apache/cassandra/thrift/CassandraServer.java
@@@ -897,20 -646,13 +897,20 @@@ public class CassandraServer implement
  
      public KsDef describe_keyspace(String table) throws NotFoundException, InvalidRequestException
      {
 -        state().hasKeyspaceAccess(table, Permission.DESCRIBE);
 +        try
 +        {
-             state().hasKeyspaceAccess(table, Permission.USE);
++            state().hasKeyspaceAccess(table, Permission.DESCRIBE);
  
 -        KSMetaData ksm = Schema.instance.getTableDefinition(table);
 -        if (ksm == null)
 -            throw new NotFoundException();
 +            KSMetaData ksm = Schema.instance.getTableDefinition(table);
 +            if (ksm == null)
 +                throw new NotFoundException();
  
 -        return ksm.toThrift();
 +            return ksm.toThrift();
 +        }
 +        catch (RequestValidationException e)
 +        {
 +            throw ThriftConversion.toThrift(e);
 +        }
      }
  
      public List<KeySlice> get_range_slices(ColumnParent column_parent, SlicePredicate
predicate, KeyRange range, ConsistencyLevel consistency_level)


Mime
View raw message