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 #=================================================