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:
parent
88e078661c
commit
f553c1322a
2 changed files with 25 additions and 6 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
#=================================================
|
||||
|
|
Loading…
Add table
Reference in a new issue