misc: only display strongbox page if it has been enabled in settings (#7129)

This commit is contained in:
Frédéric Péters 2015-05-03 18:31:33 +02:00
parent c9a827b5c2
commit dc027d89c1
1 changed files with 7 additions and 2 deletions

View File

@ -35,8 +35,13 @@ def check_visibility(target):
target = target.strip('/')
if target == 'management':
target = 'forms'
if target in ('strongbox', ) and not get_publisher().has_site_option(target):
return False
if target == 'strongbox':
if not get_publisher().has_site_option(target):
# strongbox disabled in site-options.cfg
return False
if not get_cfg('misc', {}).get('aq-strongbox'):
# strongbox disabled in settings panel
return False
admin_role = get_cfg('aq-permissions', {}).get(target, None)
if not admin_role:
return False