Use roles attribute from oslo context

Starting from version 2.2.0 oslo context has out-of-the-box 'roles'
attribute that can store user roles. So Glance doesn't need to implement
custom attribute for roles in Request Context anymore.

Change-Id: I39804ebc5f91ce6ad5bfb9c52b324d4cc8a8b115
This commit is contained in:
kairat_kushaev 2016-04-04 10:53:09 +03:00 committed by Kairat Kushaev
parent b9de463ee8
commit 6163fe1198

View File

@ -26,11 +26,9 @@ class RequestContext(context.RequestContext):
"""
def __init__(self, roles=None,
owner_is_tenant=True, service_catalog=None,
def __init__(self, owner_is_tenant=True, service_catalog=None,
policy_enforcer=None, **kwargs):
super(RequestContext, self).__init__(**kwargs)
self.roles = roles or []
self.owner_is_tenant = owner_is_tenant
self.service_catalog = service_catalog
self.policy_enforcer = policy_enforcer or policy.Enforcer()