# read-only role provides read-only permission for all scopes
READ_ONLY_ROLE = Role(
- 'read-only', 'allows read permission for all security scopes except dashboard settings', {
+ 'read-only',
+ 'allows read permission for all security scope except dashboard settings and config-opt', {
scope_name: [_P.READ] for scope_name in Scope.all_scopes()
- if scope_name != Scope.DASHBOARD_SETTINGS
+ if scope_name not in (Scope.DASHBOARD_SETTINGS, Scope.CONFIG_OPT)
})
# Config options
CLUSTER_MGR_ROLE = Role(
'cluster-manager', """allows full permissions for the hosts, osd, mon, mgr,
- and config-opt scopes.""", {
+ and config-opt scopes""", {
Scope.HOSTS: [_P.READ, _P.CREATE, _P.UPDATE, _P.DELETE],
Scope.OSD: [_P.READ, _P.CREATE, _P.UPDATE, _P.DELETE],
Scope.MONITOR: [_P.READ, _P.CREATE, _P.UPDATE, _P.DELETE],
def test_show_system_role(self):
role = self.exec_cmd('ac-role-show', rolename="read-only")
self.assertEqual(role['name'], 'read-only')
- self.assertEqual(role['description'],
- 'allows read permission for all security scopes except dashboard settings')
+ self.assertEqual(
+ role['description'],
+ 'allows read permission for all security scope except dashboard settings and config-opt'
+ )
def test_delete_system_role(self):
with self.assertRaises(CmdException) as ctx: