Attempt to simplify permission migration

This commit is contained in:
Alexandre Aubin 2020-03-30 20:09:26 +02:00
parent 13b510b624
commit ad22677994

View file

@ -197,7 +197,7 @@ EOF
if [[ "$1" == "set" ]] && [[ "${4:-}" == "/" ]] if [[ "$1" == "set" ]] && [[ "${4:-}" == "/" ]]
then then
ynh_permission_update --permission "main" --add "visitors" ynh_permission_update --permission "main" --add "visitors"
elif [[ "$1" == "delete" ]] && [[ "${current_value:-}" == "/" ]] elif [[ "$1" == "delete" ]] && [[ "${current_value:-}" == "/" ]] && [[ -n "$(ynh_app_setting_get --app=$2 --key='is_public' )" ]]
then then
ynh_permission_update --permission "main" --remove "visitors" ynh_permission_update --permission "main" --remove "visitors"
fi fi