diff --git a/scripts/install b/scripts/install index 4568211..8b5ab5f 100755 --- a/scripts/install +++ b/scripts/install @@ -36,7 +36,6 @@ ynh_script_progression --message="Storing installation settings..." ynh_app_setting_set --app $app --key admin --value $admin ynh_app_setting_set --app $app --key language --value $language ynh_app_setting_set --app $app --key final_path --value $final_path -ynh_app_setting_set --app $app --key is_public --value $is_public ynh_app_setting_set --app $app --key service_autodiscovery --value $service_autodiscovery ynh_app_setting_set --app $app --key whups_install --value $whups_install ynh_app_setting_set --app $app --key sesha_install --value $sesha_install @@ -158,11 +157,11 @@ set_permission # configure the sso ynh_script_progression --message="Configuring permissions..." -if [ "$is_public" = "0" ]; -then # Retire l'accès public - ynh_app_setting_delete --app $app --key skipped_uris -else - ynh_app_setting_set --app $app --key unprotected_uris --value "/" + +# Make app public if necessary +if [ "$is_public" -eq 1 ] +then + ynh_permission_update --permission="main" --add="visitors" fi # SETUP LOGROTATE diff --git a/scripts/upgrade b/scripts/upgrade index dee9cef..9d79eeb 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -10,6 +10,16 @@ source /usr/share/yunohost/helpers # 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 + # Import common cmd source ./experimental_helper.sh source ./_common.sh @@ -38,6 +48,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 + #================================================= # STANDARD UPGRADE STEPS #=================================================