Browse Source

[autopatch] Autopatch to migrate to new permission system

pull/57/head
Yunohost-Bot 5 years ago
committed by Alexandre Aubin
parent
commit
b824958161
  1. 7
      scripts/install
  2. 10
      scripts/upgrade

7
scripts/install

@ -49,7 +49,6 @@ ynh_script_progression --message="Storing installation settings..."
ynh_app_setting_set --app=$app --key=domain --value=$domain ynh_app_setting_set --app=$app --key=domain --value=$domain
ynh_app_setting_set --app=$app --key=path --value=$path_url ynh_app_setting_set --app=$app --key=path --value=$path_url
ynh_app_setting_set --app=$app --key=is_public --value=$is_public
ynh_app_setting_set --app=$app --key=with_mysql --value=$with_mysql ynh_app_setting_set --app=$app --key=with_mysql --value=$with_mysql
ynh_app_setting_set --app=$app --key=with_sftp --value=$with_sftp ynh_app_setting_set --app=$app --key=with_sftp --value=$with_sftp
ynh_app_setting_set --app=$app --key=final_path --value=$final_path ynh_app_setting_set --app=$app --key=final_path --value=$final_path
@ -163,10 +162,12 @@ chown root: "$final_path"
#================================================= #=================================================
ynh_script_progression --message="Configuring SSOwat..." ynh_script_progression --message="Configuring SSOwat..."
# Make app public if necessary # Make app public if necessary
if [ $is_public -eq 1 ]
if [ "$is_public" -eq 1 ]
then then
ynh_app_setting_set --app=$app --key=skipped_uris --value="/"
ynh_permission_update --permission="main" --add="visitors"
fi fi
#================================================= #=================================================

10
scripts/upgrade

@ -121,6 +121,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
#================================================= #=================================================
# ACTIVATE MAINTENANCE MODE # ACTIVATE MAINTENANCE MODE
#================================================= #=================================================

Loading…
Cancel
Save