Esempio n. 1
0
 def test_skip_policy(self):
     policy.reset()
     rules = {"network:get_all": common_policy.parse_rule("!")}
     policy.set_rules(common_policy.Rules(rules))
     api = network.API()
     self.assertRaises(exception.PolicyNotAuthorized, api.get_all, self.context)
     api = network.API(skip_policy_check=True)
     api.get_all(self.context)
Esempio n. 2
0
 def test_skip_policy(self):
     policy.reset()
     rules = {'network:get_all': common_policy.parse_rule('!')}
     policy.set_rules(common_policy.Rules(rules))
     api = network.API()
     self.assertRaises(exception.PolicyNotAuthorized,
                       api.get_all, self.context)
     api = network.API(skip_policy_check=True)
     api.get_all(self.context)
Esempio n. 3
0
 def test_skip_policy(self):
     policy.reset()
     rules = {'network:get_all': '!'}
     policy.set_rules(oslo_policy.Rules.from_dict(rules))
     api = network.API()
     self.assertRaises(exception.PolicyNotAuthorized,
                       api.get_all, self.context)
     api = network.API(skip_policy_check=True)
     api.get_all(self.context)
Esempio n. 4
0
 def test_skip_policy(self):
     policy.reset()
     rules = {'network:get_all': '!'}
     policy.set_rules(oslo_policy.Rules.from_dict(rules))
     api = network.API()
     self.assertRaises(exception.PolicyNotAuthorized, api.get_all,
                       self.context)
     api = network.API(skip_policy_check=True)
     api.get_all(self.context)