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 #=================================================