From 60f5eef99cb8055abc5d517f69b5fd81330ac50e Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 1 Aug 2021 23:24:39 +0200 Subject: [PATCH] Update upgrade --- scripts/upgrade | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index b97cab1..b908949 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -43,11 +43,31 @@ ynh_clean_setup () { ynh_abort_if_errors #================================================= -# ENSURE DOWNWARD COMPATIBILITY +# CHECK VERSION #================================================= upgrade_type=$(ynh_check_app_version_changed) +#================================================= +# ENSURE DOWNWARD COMPATIBILITY +#================================================= +ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 + +### If nobody installed your app before 4.1, +### then you may safely remove these lines + +# Cleaning legacy permissions +if ynh_legacy_permissions_exists; then + ynh_legacy_permissions_delete_all + + ynh_app_setting_delete --app=$app --key=is_public +fi + +if ! ynh_permission_exists --permission="admin"; then + # Create the required permissions + ynh_permission_create --permission="admin" --url="/admin" --allowed=$admin +fi + #================================================= # CREATE DEDICATED USER #=================================================