Esempio n. 1
0
    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)])
Esempio n. 2
0
    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)])
Esempio n. 3
0
    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)])
Esempio n. 4
0
    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)])
Esempio n. 5
0
 def test_prohibit_non_existant_node(self):
     acl = ACL(self.client, "/abc")
     yield self.assertFailure(
         acl.prohibit("zebra"), StateNotFound)
Esempio n. 6
0
 def test_prohibit_non_existant_node(self):
     acl = ACL(self.client, "/abc")
     yield self.assertFailure(acl.prohibit("zebra"), StateNotFound)