Merge "Honor keystone policy file when creating client"

This commit is contained in:
Jenkins 2014-11-12 00:43:56 +00:00 committed by Gerrit Code Review
commit ff09b75886
1 changed files with 2 additions and 1 deletions

View File

@ -34,6 +34,7 @@ from horizon import messages
from horizon.utils import functions as utils
from openstack_dashboard.api import base
from openstack_dashboard import policy
LOG = logging.getLogger(__name__)
@ -143,7 +144,7 @@ def keystoneclient(request, admin=False):
"""
user = request.user
if admin:
if not user.is_superuser:
if not policy.check(("identity", "admin_required"), request):
raise exceptions.NotAuthorized
endpoint_type = 'adminURL'
else: