horizon/openstack_dashboard/utils/identity.py
kenji-ishii 4ff448b999 Modify 'admin' used by fixed string
When we do "member update" on domain and project page,
'admin' role is used by fixed string in internal processing.
However, since kilo we can use OPENSTACK_KEYSTONE_ADMIN_ROLES
and it mean the list of roles that have administrator
privileges. So this patch modify to use this setting.

Change-Id: I3817b168e7ac448997f41c1a4f4b3a3606994297
Closes-Bug: #1527457
2016-01-15 15:12:32 +09:00

26 lines
913 B
Python

# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from django.conf import settings
from horizon.utils.memoized import memoized # noqa
class IdentityMixIn(object):
@memoized
def get_admin_roles(self):
_admin_roles = [role.lower() for role in getattr(
settings,
'OPENSTACK_KEYSTONE_ADMIN_ROLES',
['admin'])]
return _admin_roles