43e9df85ab
Since the content in a Dashboard is not hardcoded, having hardcoded policy checks to specific services at the dashboard level is wrong. The Dashboard was designed to evaluate all panels to determine policy so this type of thing could be avoided. This patch moves the content specific policy checks to the panels where they apply. Additionally, this fix uncovered another bug where policy_rules are wrapped in a list regardless of format. This patch adds a check and only wraps where necessary. Change-Id: I79314a45c3c552ebcb3bb7cc881c2467fa009c5d Closes-Bug: #1643013 Closes-Bug: #1643074
26 lines
908 B
Python
26 lines
908 B
Python
# (c) Copyright 2015 Hewlett-Packard Development Company, L.P.
|
|
# (c) Copyright 2015 ThoughtWorks, Inc.
|
|
#
|
|
# 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.utils.translation import ugettext_lazy as _
|
|
|
|
import horizon
|
|
|
|
|
|
class NGFlavors(horizon.Panel):
|
|
name = _("Flavors")
|
|
slug = 'ngflavors'
|
|
permissions = ('openstack.services.compute',)
|
|
policy_rules = (("compute", "context_is_admin"),)
|