1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/horde_ynh.git synced 2024-09-03 19:16:08 +02:00

[autopatch] Autopatch to migrate to new permission system

This commit is contained in:
Yunohost-Bot 2021-03-15 00:26:07 +01:00 committed by Alexandre Aubin
parent 88e078661c
commit f553c1322a
2 changed files with 25 additions and 6 deletions

View file

@ -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 admin --value $admin
ynh_app_setting_set --app $app --key language --value $language 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 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 service_autodiscovery --value $service_autodiscovery
ynh_app_setting_set --app $app --key whups_install --value $whups_install ynh_app_setting_set --app $app --key whups_install --value $whups_install
ynh_app_setting_set --app $app --key sesha_install --value $sesha_install ynh_app_setting_set --app $app --key sesha_install --value $sesha_install
@ -158,11 +157,11 @@ set_permission
# configure the sso # configure the sso
ynh_script_progression --message="Configuring permissions..." ynh_script_progression --message="Configuring permissions..."
if [ "$is_public" = "0" ];
then # Retire l'accès public # Make app public if necessary
ynh_app_setting_delete --app $app --key skipped_uris if [ "$is_public" -eq 1 ]
else then
ynh_app_setting_set --app $app --key unprotected_uris --value "/" ynh_permission_update --permission="main" --add="visitors"
fi fi
# SETUP LOGROTATE # SETUP LOGROTATE

View file

@ -10,6 +10,16 @@ source /usr/share/yunohost/helpers
# Exit if an error occurs during the execution of the script # Exit if an error occurs during the execution of the script
ynh_abort_if_errors 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 # Import common cmd
source ./experimental_helper.sh source ./experimental_helper.sh
source ./_common.sh source ./_common.sh
@ -38,6 +48,16 @@ ynh_clean_setup () {
# Exit if an error occurs during the execution of the script # Exit if an error occurs during the execution of the script
ynh_abort_if_errors 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 # STANDARD UPGRADE STEPS
#================================================= #=================================================