From 5a3194383fb269acfa00149c60dc92014308e9a7 Mon Sep 17 00:00:00 2001 From: Yunohost-Bot <> Date: Mon, 15 Mar 2021 00:26:27 +0100 Subject: [PATCH] [autopatch] Autopatch to migrate to new permission system --- scripts/install | 7 ++++--- scripts/upgrade | 10 ++++++++++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/scripts/install b/scripts/install index 9fdf10c..9d1276b 100644 --- a/scripts/install +++ b/scripts/install @@ -51,7 +51,6 @@ ynh_webpath_register $app $domain $path_url ynh_app_setting_set $app domain $domain ynh_app_setting_set $app path $path_url -ynh_app_setting_set $app is_public $is_public ynh_app_setting_set $app final_path $final_path #================================================= @@ -105,10 +104,12 @@ chown -R root: $final_path # SETUP SSOWAT #================================================= + + # Make app public if necessary -if [ $is_public -eq 1 ] +if [ "$is_public" -eq 1 ] then - ynh_app_setting_set $app skipped_uris "/" + ynh_permission_update --permission="main" --add="visitors" fi #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 60ef9d6..d38935d 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -56,6 +56,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 + #================================================= # CHECK THE PATH #=================================================