2016-07-12 11:18:24 |
Binoy M V |
description |
Hi,
I am trying to implement the pecan rest framework with policy. How can I do that. I tried with the following but getting error on that. Please help
My policy file (test.json)
http://pastebin.com/0pn2JPK1
I am trying to call the following from my pecan rootcontroller
test.enforce("events:index", pecan.request)
My test.py file (oslo code)
http://pastebin.com/F39VqHY5
Getting following o/p while printing the self from load_rules()
print self.__dict__
{'policy_file': 'policy.json', 'policy_path': None, 'rules': {}, 'file_rules': {}, 'overwrite': True, 'conf': <oslo_config.cfg.ConfigOpts object at 0x7f3ff02f7e90>, '_policy_dir_mtimes': {}, 'registered_rules': {}, '_file_cache': {}, 'default_rule': 'default', '_loaded_files': [], 'use_conf': True}
Is this correct behaviour. But I am passing the file as test.json. Please give me an opening for this. |
Hi,
I am trying to implement the pecan rest framework with policy. How can I do that. I tried with the following but getting error on that. Please help
My policy file (test.json)
http://pastebin.com/0pn2JPK1
I am trying to call the following from my pecan rootcontroller
test.enforce("events:index", pecan.request)
My test.py file (oslo code)
http://pastebin.com/F39VqHY5
Getting following o/p while printing the self from load_rules()
print self.__dict__
{'policy_file': 'policy.json', 'policy_path': None, 'rules': {}, 'file_rules': {}, 'overwrite': True, 'conf': <oslo_config.cfg.ConfigOpts object at 0x7f3ff02f7e90>, '_policy_dir_mtimes': {}, 'registered_rules': {}, '_file_cache': {}, 'default_rule': 'default', '_loaded_files': [], 'use_conf': True}
Is this correct behaviour? But I am passing the file as test.json. Please give me an opening for this. |
|
2016-07-14 09:30:12 |
Binoy M V |
description |
Hi,
I am trying to implement the pecan rest framework with policy. How can I do that. I tried with the following but getting error on that. Please help
My policy file (test.json)
http://pastebin.com/0pn2JPK1
I am trying to call the following from my pecan rootcontroller
test.enforce("events:index", pecan.request)
My test.py file (oslo code)
http://pastebin.com/F39VqHY5
Getting following o/p while printing the self from load_rules()
print self.__dict__
{'policy_file': 'policy.json', 'policy_path': None, 'rules': {}, 'file_rules': {}, 'overwrite': True, 'conf': <oslo_config.cfg.ConfigOpts object at 0x7f3ff02f7e90>, '_policy_dir_mtimes': {}, 'registered_rules': {}, '_file_cache': {}, 'default_rule': 'default', '_loaded_files': [], 'use_conf': True}
Is this correct behaviour? But I am passing the file as test.json. Please give me an opening for this. |
Hi,
I am trying to implement the pecan rest framework with policy. How can I do that. I tried with the following but getting error on that. Please help
My policy file (policy.json = which is in the folder "controller")
http://paste.openstack.org/show/532752/
I am trying to call the following from my pecan rootcontroller
rbac.enforce("events:index", pecan.request)
My rbac.py file (oslo code)
http://paste.openstack.org/show/532751/
I am trying to call it using the following
http://paste.openstack.org/show/532753/
Getting following o/p while printing the self from load_rules()
print self.__dict__
{'policy_file': 'policy.json', 'policy_path': None, 'rules': {}, 'file_rules': {}, 'overwrite': True, 'conf': <oslo_config.cfg.ConfigOpts object at 0x7f3ffce81d50>, '_policy_dir_mtimes': {}, 'registered_rules': {}, '_file_cache': {}, 'default_rule': 'default', '_loaded_files': [], 'use_conf': True}
Is this correct behaviour? But I am passing the file as policy.json. Please give me an opening for this. |
|