Ejemplo n.º 1
0
 def test_get_admin_permissions(self):
     admin_permissions = utils.get_admin_permissions()
     self.assertSetEqual(
         {
             'openstack.roles.foo', 'openstack.roles.bar',
             'openstack.roles.admin'
         }, admin_permissions)
Ejemplo n.º 2
0
class Monitor(horizon.Dashboard):
    name = _("Monitor")
    slug = "monitor"
    if getattr(settings, 'POLICY_CHECK_FUNCTION', None):
        policy_rules = (('monitor_info_panel', 'admin_required'), )
    else:
        permissions = (tuple(utils.get_admin_permissions()), )
class Admin(horizon.Dashboard):
    name = _("Admin")
    slug = "admin"

    if getattr(settings, 'POLICY_CHECK_FUNCTION', None):
        policy_rules = (('identity', 'admin_required'),
                        ('image', 'context_is_admin'),
                        ('volume', 'context_is_admin'),
                        ('compute', 'context_is_admin'),
                        ('network', 'context_is_admin'),)
    else:
        permissions = (tuple(utils.get_admin_permissions()),)
Ejemplo n.º 4
0
 def test_get_admin_permissions(self):
     admin_permissions = utils.get_admin_permissions()
     self.assertSetEqual({'openstack.roles.foo',
                          'openstack.roles.bar',
                          'openstack.roles.admin'}, admin_permissions)