From 534f3ef873309182c8a9d88674a3f2526a73d757 Mon Sep 17 00:00:00 2001 From: Yunohost-Bot <> Date: Mon, 15 Mar 2021 00:27:49 +0100 Subject: [PATCH] [autopatch] Autopatch to migrate to new permission system --- scripts/install | 6 +++--- scripts/upgrade | 10 ++++++++++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/scripts/install b/scripts/install index 15c23ca..e422df8 100755 --- a/scripts/install +++ b/scripts/install @@ -51,7 +51,6 @@ ynh_script_progression --message="Storing installation settings..." ynh_app_setting_set --app="$app" --key=domain --value="$domain" ynh_app_setting_set --app="$app" --key=path --value="$path_url" ynh_app_setting_set --app="$app" --key=admin --value="$admin" -ynh_app_setting_set --app="$app" --key=is_public --value="$is_public" ynh_app_setting_set --app="$app" --key=final_path --value="$final_path" ynh_app_setting_set --app="$app" --key=github_account --value="$github_account" ynh_app_setting_set --app="$app" --key=github_token --value="$github_token" @@ -272,11 +271,12 @@ yunohost service add "$app-celery" --log "/var/log/$app/weblate-celery-w1.log" #================================================= ynh_script_progression --message="Configuring SSOwat..." + + # Make app public if necessary if [ "$is_public" -eq 1 ] then - # unprotected_uris allows SSO credentials to be passed anyway. - ynh_app_setting_set --app="$app" --key=unprotected_uris --value="/" + ynh_permission_update --permission="main" --add="visitors" fi #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 3506e41..305b3cb 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -43,6 +43,16 @@ ynh_clean_setup () { # Exit if an error occurs during the execution of the script ynh_abort_if_errors +#================================================= +# Migrate legacy permissions to new system +#================================================= +if ynh_legacy_permissions_exists +then + ynh_legacy_permissions_delete_all + + ynh_app_setting_delete --app=$app --key=is_public +fi + #================================================= # ENSURE DOWNWARD COMPATIBILITY #=================================================