mirror of https://github.com/apache/superset.git
Add link on how to get permission to permission error (#4408)
* add flag to config * add troubleshooting link if there is a link * nits
This commit is contained in:
parent
9478291bf6
commit
7e082968dd
|
@ -354,6 +354,9 @@ SILENCE_FAB = True
|
|||
# It will be appended at the bottom of sql_lab errors.
|
||||
TROUBLESHOOTING_LINK = ''
|
||||
|
||||
# This link should lead to a page with instructions on how to gain access to a
|
||||
# Datasource. It will be placed at the bottom of permissions errors.
|
||||
PERMISSION_INSTRUCTIONS_LINK = ''
|
||||
|
||||
# Integrate external Blueprints to the app by passing them to your
|
||||
# configuration. These blueprints will get integrated in the app
|
||||
|
|
|
@ -64,7 +64,14 @@ DATASOURCE_MISSING_ERR = __('The datasource seems to have been deleted')
|
|||
ACCESS_REQUEST_MISSING_ERR = __(
|
||||
'The access requests seem to have been deleted')
|
||||
USER_MISSING_ERR = __('The user seems to have been deleted')
|
||||
DATASOURCE_ACCESS_ERR = __("You don't have access to this datasource")
|
||||
perms_instruction_link = config.get('PERMISSION_INSTRUCTIONS_LINK')
|
||||
if perms_instruction_link:
|
||||
DATASOURCE_ACCESS_ERR = __(
|
||||
"You don't have access to this datasource. <a href='{}'>(Gain access)</a>"
|
||||
.format(perms_instruction_link),
|
||||
)
|
||||
else:
|
||||
DATASOURCE_ACCESS_ERR = __("You don't have access to this datasource")
|
||||
|
||||
|
||||
def get_database_access_error_msg(database_name):
|
||||
|
|
Loading…
Reference in New Issue