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()))
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()))
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)))
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)))