From 7f25eda031ef8ff95c472fe019c2bca271c39194 Mon Sep 17 00:00:00 2001 From: Aeris One Date: Mon, 30 Mar 2020 13:00:23 +0200 Subject: [PATCH] Cleaning legacy permission in upgrade --- scripts/upgrade | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index df8ad30..e1307f5 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -30,12 +30,30 @@ upgrade_type=$(ynh_check_app_version_changed) #================================================= ynh_script_progression --message="Ensuring downward compatibility..." -# REMOVE SKIPPED_URIS +# Cleaning legacy permissions +is_public=$(ynh_app_setting_get --app=$app --key=is_public) skipped_uris=$(ynh_app_setting_get --app=$app --key=skipped_uris) +unprotected_uris=$(ynh_app_setting_get --app=$app --key=unprotected_uris) +protected_uris=$(ynh_app_setting_get --app=$app --key=protected_uris) -# Unused with the permission system +# Remove is_public if exists +if [ ! -z "$is_public" ]; then + ynh_app_setting_delete --app=$app --key=is_public +fi + +# Remove skipped_uris if exists if [ ! -z "$skipped_uris" ]; then - ynh_app_setting_delete --app=$app --key=skipped_uris + ynh_app_setting_delete --app=$app --key=skipped_uris +fi + +# Remove unprotected_uris if exists +if [ ! -z "$unprotected_uris" ]; then + ynh_app_setting_delete --app=$app --key=unprotected_uris +fi + +# Remove protected_uris if exists +if [ ! -z "$protected_uris" ]; then + ynh_app_setting_delete --app=$app --key=protected_uris fi # If final_path doesn't exist, create it