1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/weblate_ynh.git synced 2024-10-01 13:35:04 +02:00

Merge pull request #41 from yunohost-bot/new-permission-system

[autopatch] Autopatch to migrate to new permission system
This commit is contained in:
Kayou 2021-06-17 16:35:09 +02:00 committed by GitHub
commit 6d6aaaa92c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 3 deletions

View file

@ -51,7 +51,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=admin --value="$admin" ynh_app_setting_set --app="$app" --key=admin --value="$admin"
ynh_app_setting_set --app="$app" --key=is_public --value="$is_public"
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=github_account --value="$github_account" ynh_app_setting_set --app="$app" --key=github_account --value="$github_account"
ynh_app_setting_set --app="$app" --key=github_token --value="$github_token" ynh_app_setting_set --app="$app" --key=github_token --value="$github_token"
@ -279,11 +278,12 @@ yunohost service add "$app-celery" --log "/var/log/$app/weblate-celery-w1.log"
#================================================= #=================================================
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
# unprotected_uris allows SSO credentials to be passed anyway. ynh_permission_update --permission="main" --add="visitors"
ynh_app_setting_set --app="$app" --key=unprotected_uris --value="/"
fi fi
#================================================= #=================================================

View file

@ -43,6 +43,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
#================================================= #=================================================
# ENSURE DOWNWARD COMPATIBILITY # ENSURE DOWNWARD COMPATIBILITY
#================================================= #=================================================