Ejemplo n.º 1
0
 def test_checkUnauthenticated(self):
     # DelegatedAuthorization.checkUnauthenticated() punts the checks back
     # up to the security policy by generating (object, permission) tuples.
     # The security policy is in a much better position to, well, apply
     # policy.
     obj, delegated_obj = object(), object()
     authorization = DelegatedAuthorization(obj, delegated_obj,
                                            "dedicatemyselfto.Evil")
     self.assertEqual([(delegated_obj, "dedicatemyselfto.Evil")],
                      list(authorization.checkUnauthenticated()))
Ejemplo n.º 2
0
 def test_checkUnauthenticated(self):
     # DelegatedAuthorization.checkUnauthenticated() punts the checks back
     # up to the security policy by generating (object, permission) tuples.
     # The security policy is in a much better position to, well, apply
     # policy.
     obj, delegated_obj = object(), object()
     authorization = DelegatedAuthorization(
         obj, delegated_obj, "dedicatemyselfto.Evil")
     self.assertEqual(
         [(delegated_obj, "dedicatemyselfto.Evil")],
         list(authorization.checkUnauthenticated()))
Ejemplo n.º 3
0
 def test_checkAuthenticated(self):
     # DelegatedAuthorization.checkAuthenticated() punts the checks back up
     # to the security policy by generating (object, permission) tuples.
     # The security policy is in a much better position to, well, apply
     # policy.
     obj, delegated_obj = object(), object()
     authorization = DelegatedAuthorization(obj, delegated_obj,
                                            "dedicatemyselfto.Evil")
     # By default DelegatedAuthorization.checkAuthenticated() ignores its
     # user argument, so we pass None in below, but it is required for
     # IAuthorization, and may be useful for subclasses.
     self.assertEqual([(delegated_obj, "dedicatemyselfto.Evil")],
                      list(authorization.checkAuthenticated(None)))
Ejemplo n.º 4
0
 def test_checkAuthenticated(self):
     # DelegatedAuthorization.checkAuthenticated() punts the checks back up
     # to the security policy by generating (object, permission) tuples.
     # The security policy is in a much better position to, well, apply
     # policy.
     obj, delegated_obj = object(), object()
     authorization = DelegatedAuthorization(
         obj, delegated_obj, "dedicatemyselfto.Evil")
     # By default DelegatedAuthorization.checkAuthenticated() ignores its
     # user argument, so we pass None in below, but it is required for
     # IAuthorization, and may be useful for subclasses.
     self.assertEqual(
         [(delegated_obj, "dedicatemyselfto.Evil")],
         list(authorization.checkAuthenticated(None)))