assertTrue(all.implies(collection1));
}
@Test
public void testCollectionAll() throws Exception {
Privilege collectionAll = create(new KeyValue("collection", ALL));
Privilege collection1 = create(new KeyValue("collection", "coll1"));
assertTrue(collectionAll.implies(collection1));
assertTrue(collection1.implies(collectionAll));
Privilege allUpdate =
create(new KeyValue("collection", ALL), new KeyValue("action", "update"));
Privilege allQuery =
create(new KeyValue("collection", ALL), new KeyValue("action", "query"));
Privilege coll1Update =
create(new KeyValue("collection", "coll1"), new KeyValue("action", "update"));
Privilege coll1Query =
create(new KeyValue("collection", "coll1"), new KeyValue("action", "query"));
assertTrue(allUpdate.implies(coll1Update));
assertTrue(allQuery.implies(coll1Query));
assertTrue(coll1Update.implies(allUpdate));
assertTrue(coll1Query.implies(allQuery));
assertFalse(allUpdate.implies(coll1Query));