diff --git a/data/helpers.d/setting b/data/helpers.d/setting index 9dbbe93fa..5bcd7af32 100644 --- a/data/helpers.d/setting +++ b/data/helpers.d/setting @@ -187,9 +187,15 @@ EOF # Fucking legacy permission management. # We need this because app temporarily set the app as unprotected to configure it with curl... - if [[ "$3" =~ ^(unprotected|skipped)_ ]] && [[ "${4:-}" == "/" ]] + if [[ "$3" =~ ^(unprotected|skipped)_ ]] then - ynh_permission_update --permission "main" --add "visitors" + if [[ "$1" == "set" ]] && [[ "${4:-}" == "/" ]] + then + ynh_permission_update --permission "main" --add "visitors" + elif [[ "$1" == "delete" ]] + then + ynh_permission_update --permission "main" --remove "visitors" + fi fi }