diff --git a/test/conf/access.properties b/test/conf/access.properties index 0a5e1bd35d..ef6c8c43fe 100644 --- a/test/conf/access.properties +++ b/test/conf/access.properties @@ -24,5 +24,6 @@ # list of keyspaces: all users will be able to view the list of keyspaces. =user1 -Keyspace1.=user1,user2 -Keyspace1.=user1,user2 +Keyspace1.=user1,user2 +Keyspace1.Standard1.=user2 +Keyspace1.Standard1.=user1 diff --git a/test/unit/org/apache/cassandra/auth/SimpleAuthorityTest.java b/test/unit/org/apache/cassandra/auth/SimpleAuthorityTest.java index 0660954531..cc1384c5d0 100644 --- a/test/unit/org/apache/cassandra/auth/SimpleAuthorityTest.java +++ b/test/unit/org/apache/cassandra/auth/SimpleAuthorityTest.java @@ -23,7 +23,6 @@ import java.util.Arrays; import java.util.EnumSet; import java.util.List; -import org.junit.Before; import org.junit.Test; import static org.junit.Assert.assertEquals; @@ -38,6 +37,10 @@ public class SimpleAuthorityTest private final List KEYSPACES_RESOURCE = Arrays.asList(Resources.ROOT, Resources.KEYSPACES); private final List KEYSPACE1_RESOURCE = Arrays.asList(Resources.ROOT, Resources.KEYSPACES, "Keyspace1"); private final List KEYSPACE2_RESOURCE = Arrays.asList(Resources.ROOT, Resources.KEYSPACES, "Keyspace2"); + private final List STANDARD1_RESOURCE = Arrays.asList(Resources.ROOT, + Resources.KEYSPACES, + "Keyspace1", + "Standard1"); @Test public void testValidateConfiguration() throws Exception @@ -70,4 +73,12 @@ public class SimpleAuthorityTest EnumSet.of(Permission.READ), authority.authorize(USER3, KEYSPACES_RESOURCE)); } + + @Test + public void testAuthorizeColumnFamily() throws Exception + { + assertEquals(Permission.ALL, authority.authorize(USER1, STANDARD1_RESOURCE)); + assertEquals(EnumSet.of(Permission.READ), authority.authorize(USER2, STANDARD1_RESOURCE)); + assertEquals(Permission.NONE, authority.authorize(USER3, STANDARD1_RESOURCE)); + } }