From 234e92a0dbb60c045169ad2f1a4b8198f25dc50b Mon Sep 17 00:00:00 2001 From: Yunohost-Bot <> Date: Mon, 15 Mar 2021 00:26:20 +0100 Subject: [PATCH] [autopatch] Autopatch to migrate to new permission system --- scripts/install | 5 +++-- scripts/upgrade | 10 ++++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index f1409be..971a2f6 100644 --- a/scripts/install +++ b/scripts/install @@ -175,12 +175,13 @@ chown www-data:www-data -R /tmp/jeedom # SETUP SSOWAT #================================================= ynh_script_progression --message="Configuring SSOwat..." +ynh_permission_update --permission="main" --add="visitors" # Remove the public access -ynh_app_setting_delete --app=$app --key=skipped_uris + # Access to API without SSO -ynh_app_setting_set --app=$app --key=unprotected_uris --value="/core/api/jeeApi.php" + #================================================= # RELOAD NGINX diff --git a/scripts/upgrade b/scripts/upgrade index 53a4dc9..0c203bf 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -75,6 +75,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 #=================================================