mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Print warning if packager try to show tile for regex and disable show tile in this case
This commit is contained in:
parent
1ff4f578d7
commit
e6ccb01af1
3 changed files with 7 additions and 2 deletions
|
@ -501,6 +501,7 @@
|
||||||
"regenconf_dry_pending_applying": "Checking pending configuration which would have been applied for category '{category}'…",
|
"regenconf_dry_pending_applying": "Checking pending configuration which would have been applied for category '{category}'…",
|
||||||
"regenconf_failed": "Could not regenerate the configuration for category(s): {categories}",
|
"regenconf_failed": "Could not regenerate the configuration for category(s): {categories}",
|
||||||
"regenconf_pending_applying": "Applying pending configuration for category '{category}'…",
|
"regenconf_pending_applying": "Applying pending configuration for category '{category}'…",
|
||||||
|
"regex_incompatible_with_tile": "/!\\ Packagers! You for the permission '{permission}' can't set the regex {regex} as main url and set 'show_tile' to 'true'",
|
||||||
"regex_with_only_domain": "You can't use a regex for domain, only for path",
|
"regex_with_only_domain": "You can't use a regex for domain, only for path",
|
||||||
"restore_already_installed_app": "An app with the ID '{app:s}' is already installed",
|
"restore_already_installed_app": "An app with the ID '{app:s}' is already installed",
|
||||||
"restore_app_failed": "Could not restore the app '{app:s}'",
|
"restore_app_failed": "Could not restore the app '{app:s}'",
|
||||||
|
|
|
@ -1325,7 +1325,7 @@ def app_ssowatconf():
|
||||||
permissions[perm_name] = {
|
permissions[perm_name] = {
|
||||||
"users": perm_info['corresponding_users'],
|
"users": perm_info['corresponding_users'],
|
||||||
"label": perm_info['label'],
|
"label": perm_info['label'],
|
||||||
"show_tile": perm_info['show_tile'],
|
"show_tile": perm_info['show_tile'] if not perm_info["url"].startswith('re:') else False,
|
||||||
"auth_header": perm_info['auth_header'],
|
"auth_header": perm_info['auth_header'],
|
||||||
"public": "visitors" in perm_info["allowed"],
|
"public": "visitors" in perm_info["allowed"],
|
||||||
"uris": uris
|
"uris": uris
|
||||||
|
|
|
@ -167,6 +167,9 @@ def user_permission_update(operation_logger, permission, add=None, remove=None,
|
||||||
if "visitors" not in new_allowed_groups or len(new_allowed_groups) >= 3:
|
if "visitors" not in new_allowed_groups or len(new_allowed_groups) >= 3:
|
||||||
logger.warning(m18n.n("permission_currently_allowed_for_all_users"))
|
logger.warning(m18n.n("permission_currently_allowed_for_all_users"))
|
||||||
|
|
||||||
|
if existing_permission['url'].startswith('re:') and show_tile:
|
||||||
|
logger.warning(m18n.n('regex_incompatible_with_tile', regex=existing_permission['url'], permission=permission))
|
||||||
|
|
||||||
# Commit the new allowed group list
|
# Commit the new allowed group list
|
||||||
operation_logger.start()
|
operation_logger.start()
|
||||||
|
|
||||||
|
@ -351,6 +354,8 @@ def permission_url(operation_logger, permission,
|
||||||
url = _check_and_normalize_permission_path(url)
|
url = _check_and_normalize_permission_path(url)
|
||||||
domain, path = _get_full_url(url, app_main_path).split('/', 1)
|
domain, path = _get_full_url(url, app_main_path).split('/', 1)
|
||||||
conflicts = _get_conflicting_apps(domain, path, ignore_app=permission.spit('.')[0])
|
conflicts = _get_conflicting_apps(domain, path, ignore_app=permission.spit('.')[0])
|
||||||
|
if url.startswith('re:') and existing_permission['show_tile']:
|
||||||
|
logger.warning(m18n.n('regex_incompatible_with_tile', regex=url, permission=permission))
|
||||||
|
|
||||||
if conflicts:
|
if conflicts:
|
||||||
apps = []
|
apps = []
|
||||||
|
@ -547,7 +552,6 @@ def _update_ldap_group_permission(permission, allowed,
|
||||||
|
|
||||||
if show_tile is None:
|
if show_tile is None:
|
||||||
show_tile = existing_permission["show_tile"]
|
show_tile = existing_permission["show_tile"]
|
||||||
# TODO set show_tile to False if url is regex
|
|
||||||
|
|
||||||
if protected is None:
|
if protected is None:
|
||||||
protected = existing_permission["protected"]
|
protected = existing_permission["protected"]
|
||||||
|
|
Loading…
Add table
Reference in a new issue