From 5606ee2b8b307a9be0a46367815fdcd5a3e02c13 Mon Sep 17 00:00:00 2001 From: tituspijean Date: Wed, 7 Apr 2021 18:40:42 +0200 Subject: [PATCH] Permissions in upgrade should be for downward compatibility --- scripts/upgrade | 31 ++++++++++++------------------- 1 file changed, 12 insertions(+), 19 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 8384e76..da87e9a 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -55,6 +55,18 @@ if ynh_legacy_permissions_exists; then ynh_app_setting_delete --app=$app --key=is_public fi +# Giving admin permission to the specified used +if ! ynh_permission_exists --permission "admin" +then + ynh_permission_create --permission "admin" --allowed "$admin" +fi + +# Creating user permission +if ! ynh_permission_exists --permission "user" +then + ynh_permission_create --permission "user" +fi + # If fpm_footprint doesn't exist, create it if [ -z "$fpm_footprint" ]; then fpm_footprint=medium @@ -167,25 +179,6 @@ chmod 640 "$final_path/user/config/plugins/login-ldap.yaml" echo "* * * * * $app php${YNH_PHP_VERSION} $final_path/bin/grav scheduler 1>> /dev/null 2>&1" > /etc/cron.d/$app -#================================================= -# SETUP PERMISSIONS -#================================================= -ynh_script_progression --message="Configuring permissions..." --weight=1 - -# Giving admin permission to the specified used -if ! ynh_permission_exists --permission "admin" -then - ynh_permission_create --permission "admin" --allowed "$admin" -else - ynh_permission_update --permission "admin" --add "$admin" -fi - -# Creating user permission -if ! ynh_permission_exists --permission "user" -then - ynh_permission_create --permission "user" -fi - #================================================= # RELOAD NGINX AND PHP-FPM #=================================================