Only show DB picker for permissioned users
This commit is contained in:
parent
b6bd095d8e
commit
57e22c9ff5
2 changed files with 18 additions and 13 deletions
|
@ -2276,18 +2276,21 @@ class MasterView(View):
|
|||
kwargs['expose_db_picker'] = False
|
||||
if self.supports_multiple_engines:
|
||||
|
||||
# view declares support for multiple engines, but we only want to
|
||||
# show the picker if we have more than one engine configured
|
||||
engines = self.get_db_engines()
|
||||
if len(engines) > 1:
|
||||
# DB picker is only shown for permissioned users
|
||||
if self.request.has_perm('common.change_db_engine'):
|
||||
|
||||
# user session determines "current" db engine *of this type*
|
||||
# (note that many master views may declare the same type, and
|
||||
# would therefore share the "current" engine)
|
||||
selected = self.get_current_engine_dbkey()
|
||||
kwargs['expose_db_picker'] = True
|
||||
kwargs['db_picker_options'] = [tags.Option(k) for k in engines]
|
||||
kwargs['db_picker_selected'] = selected
|
||||
# view declares support for multiple engines, but we only want to
|
||||
# show the picker if we have more than one engine configured
|
||||
engines = self.get_db_engines()
|
||||
if len(engines) > 1:
|
||||
|
||||
# user session determines "current" db engine *of this type*
|
||||
# (note that many master views may declare the same type, and
|
||||
# would therefore share the "current" engine)
|
||||
selected = self.get_current_engine_dbkey()
|
||||
kwargs['expose_db_picker'] = True
|
||||
kwargs['db_picker_options'] = [tags.Option(k) for k in engines]
|
||||
kwargs['db_picker_selected'] = selected
|
||||
|
||||
# add info for downloadable input file templates, if any
|
||||
if self.has_input_file_templates:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue