diff --git a/openstack_dashboard/conf/ceilometer_policy.json b/openstack_dashboard/conf/ceilometer_policy.json new file mode 100644 index 000000000..4c3ec47af --- /dev/null +++ b/openstack_dashboard/conf/ceilometer_policy.json @@ -0,0 +1,6 @@ +{ + "context_is_admin": "role:admin", + "context_is_project": "project_id:%(target.project_id)s", + "context_is_owner": "user_id:%(target.user_id)s", + "segregation": "rule:context_is_admin" +} diff --git a/openstack_dashboard/dashboards/admin/metering/panel.py b/openstack_dashboard/dashboards/admin/metering/panel.py index 5e6985b1e..10dc37d54 100644 --- a/openstack_dashboard/dashboards/admin/metering/panel.py +++ b/openstack_dashboard/dashboards/admin/metering/panel.py @@ -19,7 +19,9 @@ from openstack_dashboard.dashboards.admin import dashboard class Metering(horizon.Panel): name = _("Resource Usage") slug = 'metering' - permissions = ('openstack.services.metering', 'openstack.roles.admin', ) + permissions = ('openstack.services.metering', ) + policy_rules = (('telemetry', 'telemetry:compute_statistics'), + ('telemetry', 'telemetry:get_meter'),) dashboard.Admin.register(Metering) diff --git a/openstack_dashboard/settings.py b/openstack_dashboard/settings.py index 100c848e6..c5bdc1c8a 100644 --- a/openstack_dashboard/settings.py +++ b/openstack_dashboard/settings.py @@ -223,6 +223,7 @@ POLICY_FILES = { 'image': 'glance_policy.json', 'orchestration': 'heat_policy.json', 'network': 'neutron_policy.json', + 'telemetry': 'ceilometer_policy.json', } SECRET_KEY = None