Define context.roles using base class
In Ia575ba803a0fb70f39146bd75d381ed19414bd23, oslo.context (2.2.0) added roles support in the context itself. This passing roles to super()__init__. Depends-On: I74168f8aa7d4875b160e44ff53b9abd6083d1fe4 Change-Id: Idcf2acd020634881f0fd91d666fd0d0de56042de
This commit is contained in:
parent
56a8fe0cc7
commit
666a05c402
@ -103,7 +103,8 @@ class RequestContext(context.RequestContext):
|
||||
show_deleted=kwargs.pop('show_deleted', False),
|
||||
request_id=request_id,
|
||||
resource_uuid=kwargs.pop('resource_uuid', None),
|
||||
overwrite=overwrite)
|
||||
overwrite=overwrite,
|
||||
roles=roles)
|
||||
# oslo_context's RequestContext.to_dict() generates this field, we can
|
||||
# safely ignore this as we don't use it.
|
||||
kwargs.pop('user_identity', None)
|
||||
@ -116,7 +117,6 @@ class RequestContext(context.RequestContext):
|
||||
# get rid of them.
|
||||
self.user_id = user_id
|
||||
self.project_id = project_id
|
||||
self.roles = roles or []
|
||||
self.read_deleted = read_deleted
|
||||
self.remote_address = remote_address
|
||||
if not timestamp:
|
||||
@ -183,7 +183,6 @@ class RequestContext(context.RequestContext):
|
||||
'project_id': getattr(self, 'project_id', None),
|
||||
'is_admin': getattr(self, 'is_admin', None),
|
||||
'read_deleted': getattr(self, 'read_deleted', 'no'),
|
||||
'roles': getattr(self, 'roles', None),
|
||||
'remote_address': getattr(self, 'remote_address', None),
|
||||
'timestamp': utils.strtime(self.timestamp) if hasattr(
|
||||
self, 'timestamp') else None,
|
||||
|
Loading…
x
Reference in New Issue
Block a user