Merge "The admin role judge exception caused the policy to fail"
This commit is contained in:
commit
2ecacc34b3
|
@ -119,7 +119,7 @@ def _extract_context_from_environ(environ):
|
||||||
context_paras[key] = environ.get(context_paras[key])
|
context_paras[key] = environ.get(context_paras[key])
|
||||||
role = environ.get('HTTP_X_ROLE')
|
role = environ.get('HTTP_X_ROLE')
|
||||||
# TODO(zhiyuan): replace with policy check
|
# TODO(zhiyuan): replace with policy check
|
||||||
context_paras['is_admin'] = role == 'admin'
|
context_paras['is_admin'] = 'admin' in role.split(',') if role else False
|
||||||
return t_context.Context(**context_paras)
|
return t_context.Context(**context_paras)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -55,7 +55,7 @@ def extract_context_from_environ():
|
||||||
context_paras[key] = environ.get(context_paras[key])
|
context_paras[key] = environ.get(context_paras[key])
|
||||||
role = environ.get('HTTP_X_ROLE')
|
role = environ.get('HTTP_X_ROLE')
|
||||||
|
|
||||||
context_paras['is_admin'] = role == 'admin'
|
context_paras['is_admin'] = 'admin' in role.split(',') if role else False
|
||||||
return Context(**context_paras)
|
return Context(**context_paras)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue