settings: do not export roles when managed by idp (#24224)
This commit is contained in:
parent
bbe38a8fad
commit
156b198b1a
|
@ -3719,6 +3719,23 @@ def test_settings_export_import(pub):
|
|||
assert 'Imported successfully' in resp.body
|
||||
assert '1 forms' in resp.body
|
||||
|
||||
# do not export roles when managed by idp
|
||||
pub.cfg['sp'] = {'idp-manage-roles': True}
|
||||
pub.write_cfg()
|
||||
resp = app.get('/backoffice/settings/export')
|
||||
resp = resp.form.submit('submit')
|
||||
zip_content = StringIO.StringIO(resp.body)
|
||||
zipf = zipfile.ZipFile(zip_content, 'a')
|
||||
filelist = zipf.namelist()
|
||||
assert 'formdefs/1' in filelist
|
||||
assert 'workflows/1' in filelist
|
||||
assert 'roles/1' not in filelist
|
||||
assert 'categories/1' in filelist
|
||||
assert 'datasources/1' in filelist
|
||||
assert 'wscalls/corge' in filelist
|
||||
for filename in filelist:
|
||||
assert not '.indexes' in filename
|
||||
|
||||
def test_settings_themes(pub):
|
||||
create_superuser(pub)
|
||||
app = login(get_app(pub))
|
||||
|
|
|
@ -816,7 +816,8 @@ class SettingsDirectory(QommonSettingsDirectory):
|
|||
form = Form(enctype="multipart/form-data")
|
||||
form.add(CheckboxWidget, 'formdefs', title = _('Forms'), value = True)
|
||||
form.add(CheckboxWidget, 'workflows', title = _('Workflows'), value = True)
|
||||
form.add(CheckboxWidget, 'roles', title = _('Roles'), value = True)
|
||||
if not get_cfg('sp', {}).get('idp-manage-roles'):
|
||||
form.add(CheckboxWidget, 'roles', title = _('Roles'), value = True)
|
||||
form.add(CheckboxWidget, 'categories', title = _('Categories'), value = True)
|
||||
form.add(CheckboxWidget, 'settings', title = _('Settings'), value = False)
|
||||
form.add(CheckboxWidget, 'datasources', title=_('Data sources'), value=True)
|
||||
|
|
Loading…
Reference in New Issue