From e3f8f5b4353dd02b8eeeb91f25a86e15ca7d95f9 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Thu, 18 Mar 2021 19:12:14 +0100 Subject: [PATCH] Update upgrade --- scripts/upgrade | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 93506a0..8e535ce 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -37,19 +37,10 @@ if [ -z "$final_path" ]; then ynh_app_setting_set --app=$app --key=final_path --value=$final_path fi -# Migrate from legacy permission system -is_public=$(ynh_app_setting_get --app=$app --key=is_public) +# Cleaning legacy permissions +if ynh_legacy_permissions_exists; then + ynh_legacy_permissions_delete_all -if [ -n "$is_public" ]; then - # Removing skipped/unprotected_uris under certain conditions, remove the visitors group added during the migration process of 3.7 - # Remove skipped_uris. If the app was public, add visitors again to the main permission - if ynh_permission_has_user --permission=main --user=visitors - then - ynh_app_setting_delete --app=$app --key=skipped_uris - ynh_permission_update --permission="main" --add="visitors" - else - ynh_app_setting_delete --app=$app --key=skipped_uris - fi ynh_app_setting_delete --app=$app --key=is_public fi