mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
remove visitors only for if current value is /
This commit is contained in:
parent
6e427374ec
commit
026c666d7e
1 changed files with 6 additions and 1 deletions
|
@ -158,6 +158,11 @@ ynh_add_protected_uris() {
|
||||||
#
|
#
|
||||||
ynh_app_setting()
|
ynh_app_setting()
|
||||||
{
|
{
|
||||||
|
if [[ "$1" == "delete" ]] && [[ "$3" =~ ^(unprotected|skipped)_ ]]
|
||||||
|
then
|
||||||
|
current_value=$(ynh_app_setting_get --app=$app --key=$3)
|
||||||
|
fi
|
||||||
|
|
||||||
ACTION="$1" APP="$2" KEY="$3" VALUE="${4:-}" python2.7 - <<EOF
|
ACTION="$1" APP="$2" KEY="$3" VALUE="${4:-}" python2.7 - <<EOF
|
||||||
import os, yaml, sys
|
import os, yaml, sys
|
||||||
app, action = os.environ['APP'], os.environ['ACTION'].lower()
|
app, action = os.environ['APP'], os.environ['ACTION'].lower()
|
||||||
|
@ -192,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" ]]
|
elif [[ "$1" == "delete" ]] && [[ "${current_value:-}" == "/" ]]
|
||||||
then
|
then
|
||||||
ynh_permission_update --permission "main" --remove "visitors"
|
ynh_permission_update --permission "main" --remove "visitors"
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Add table
Reference in a new issue