Define context.roles with base class
In f383bd2973c58c5272504603e4f9dddd55c5bb68, oslo.context (2.2.0) added roles support in the context itself. This passes roles to super()__init__. Change-Id: If38d7bb60388e98c8d9c395c2ee127894d70711b
This commit is contained in:
parent
87bddf4ff8
commit
2cb2f1e922
|
@ -47,14 +47,14 @@ class ContextBase(oslo_context.RequestContext):
|
|||
user=user_id, tenant=tenant_id,
|
||||
is_admin=is_admin,
|
||||
request_id=request_id,
|
||||
overwrite=overwrite)
|
||||
overwrite=overwrite,
|
||||
roles=roles)
|
||||
self.user_name = user_name
|
||||
self.tenant_name = tenant_name
|
||||
|
||||
if not timestamp:
|
||||
timestamp = datetime.datetime.utcnow()
|
||||
self.timestamp = timestamp
|
||||
self.roles = roles or []
|
||||
self.is_advsvc = is_advsvc
|
||||
if self.is_advsvc is None:
|
||||
self.is_advsvc = self.is_admin or policy.check_is_advsvc(self)
|
||||
|
@ -87,7 +87,6 @@ class ContextBase(oslo_context.RequestContext):
|
|||
'user_id': self.user_id,
|
||||
'tenant_id': self.tenant_id,
|
||||
'project_id': self.project_id,
|
||||
'roles': self.roles,
|
||||
'timestamp': str(self.timestamp),
|
||||
'tenant_name': self.tenant_name,
|
||||
'project_name': self.tenant_name,
|
||||
|
|
Loading…
Reference in New Issue