authorize_wsgi.py (openstack-cyborg-8.0.0) | : | authorize_wsgi.py (openstack-cyborg-9.0.0) | ||
---|---|---|---|---|
skipping to change at line 187 | skipping to change at line 187 | |||
except Exception: | except Exception: | |||
return return_error(500) | return return_error(500) | |||
elif need_target: | elif need_target: | |||
# if developer do not set _get_resource, just set target as | # if developer do not set _get_resource, just set target as | |||
# empty, then follow authorize method will fail and throw an | # empty, then follow authorize method will fail and throw an | |||
# exception | # exception | |||
target = {} | target = {} | |||
else: | else: | |||
# for create method, before resource exsites, we can check the | # for create method, before resource exsites, we can check the | |||
# the credentials with itself. | # the credentials with itself. | |||
target = {'project_id': context.tenant, | target = {'project_id': context.project_id, | |||
'user_id': context.user} | 'user_id': context.user_id} | |||
try: | try: | |||
authorize(action, target, credentials, do_raise=True) | authorize(action, target, credentials, do_raise=True) | |||
except Exception: | except Exception: | |||
return return_error(403) | return return_error(403) | |||
return fn(self, *args, **kwargs) | return fn(self, *args, **kwargs) | |||
return handle | return handle | |||
End of changes. 1 change blocks. | ||||
2 lines changed or deleted | 2 lines changed or added |