def test_prohibit_not_in_acl(self): principal = Principal("zebra", "stripes") yield self.tokens.add(principal) path = yield self.client.create( "/abc", acls=[make_ace(self.admin.get_token(), all=True)]) acl = ACL(self.client, path) # We get to the same end state so its fine. yield acl.prohibit("zebra") acl, stat = yield self.client.get_acl(path) self.assertEqual(acl, [make_ace(self.admin.get_token(), all=True)])
def test_prohibit_not_in_acl(self): principal = Principal("zebra", "stripes") yield self.tokens.add(principal) path = yield self.client.create("/abc", acls=[ make_ace(self.admin.get_token(), all=True)]) acl = ACL(self.client, path) # We get to the same end state so its fine. yield acl.prohibit("zebra") acl, stat = yield self.client.get_acl(path) self.assertEqual( acl, [make_ace(self.admin.get_token(), all=True)])
def test_prohibit(self): principal = Principal("zebra", "stripes") yield self.tokens.add(principal) path = yield self.client.create("/abc", acls=[ make_ace(self.admin.get_token(), all=True), make_ace(principal.get_token(), write=True)]) acl = ACL(self.client, path) yield acl.prohibit("zebra") acl, stat = yield self.client.get_acl(path) self.assertEqual( acl, [make_ace(self.admin.get_token(), all=True)])
def test_prohibit(self): principal = Principal("zebra", "stripes") yield self.tokens.add(principal) path = yield self.client.create("/abc", acls=[ make_ace(self.admin.get_token(), all=True), make_ace(principal.get_token(), write=True) ]) acl = ACL(self.client, path) yield acl.prohibit("zebra") acl, stat = yield self.client.get_acl(path) self.assertEqual(acl, [make_ace(self.admin.get_token(), all=True)])
def test_prohibit_non_existant_node(self): acl = ACL(self.client, "/abc") yield self.assertFailure( acl.prohibit("zebra"), StateNotFound)
def test_prohibit_non_existant_node(self): acl = ACL(self.client, "/abc") yield self.assertFailure(acl.prohibit("zebra"), StateNotFound)