Skip to content

Commit

Permalink
Closes-Bug: #18280
Browse files Browse the repository at this point in the history
If HTTP_X_ROLE not found, then copy from HTTP_X_API_ROLE

Change-Id: Ic00603df974ffcc85e7c78e1a23fe37e6da2bf56
(cherry picked from commit d2835c7)
  • Loading branch information
biswajit-mandal committed Apr 20, 2016
1 parent 165e7e8 commit 405c495
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/config/api-server/vnc_auth_keystone.py
Expand Up @@ -128,6 +128,11 @@ def __call__(self, env, start_response):
env['HTTP_X_ROLE'] = env['HTTP_X_API_ROLE']
"""

# If HTTP_X_ROLE not found, then copy from HTTP_X_API_ROLE
if 'HTTP_X_API_ROLE' in env:
if not 'HTTP_X_ROLE' in env or len(env['HTTP_X_ROLE']) == 0:
env['HTTP_X_ROLE'] = env['HTTP_X_API_ROLE']

# only allow admin access when MT is on
roles = []
if 'HTTP_X_ROLE' in env:
Expand Down

0 comments on commit 405c495

Please sign in to comment.