summaryrefslogtreecommitdiff
path: root/openstack_dashboard/dashboards/admin/defaults/panel.py
diff options
context:
space:
mode:
Diffstat (limited to 'openstack_dashboard/dashboards/admin/defaults/panel.py')
-rw-r--r--openstack_dashboard/dashboards/admin/defaults/panel.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/openstack_dashboard/dashboards/admin/defaults/panel.py b/openstack_dashboard/dashboards/admin/defaults/panel.py
index 9dfee0267..2d9597388 100644
--- a/openstack_dashboard/dashboards/admin/defaults/panel.py
+++ b/openstack_dashboard/dashboards/admin/defaults/panel.py
@@ -12,6 +12,7 @@
# License for the specific language governing permissions and limitations
# under the License.
+from django.conf import settings
from django.utils.translation import gettext_lazy as _
import horizon
@@ -22,3 +23,9 @@ class Defaults(horizon.Panel):
slug = 'defaults'
policy_rules = (("compute", "context_is_admin"),
("volume", "context_is_admin"),)
+
+ def allowed(self, context):
+ if (('compute' in settings.SYSTEM_SCOPE_SERVICES) !=
+ bool(context['request'].user.system_scoped)):
+ return False
+ return super().allowed(context)