mirror of
https://github.com/YunoHost/test_apps.git
synced 2024-09-03 20:06:29 +02:00
36 lines
1.1 KiB
Bash
36 lines
1.1 KiB
Bash
#!/bin/bash
|
|
|
|
#=================================================
|
|
# GENERIC START
|
|
#=================================================
|
|
|
|
# Source YunoHost helpers
|
|
source /usr/share/yunohost/helpers
|
|
|
|
# Stop script if errors
|
|
ynh_abort_if_errors
|
|
|
|
# Retrieve arguments
|
|
app=$YNH_APP_INSTANCE_NAME
|
|
admin_user=$(ynh_app_setting_get --app $app --key admin_user)
|
|
domain=$(ynh_app_setting_get --app $app --key domain)
|
|
domain_2=$(ynh_app_setting_get --app $app --key domain_2)
|
|
|
|
#=================================================
|
|
# UPDATE PERMISSIONS
|
|
#=================================================
|
|
|
|
ynh_permission_update --permission admin --remove $admin_user --show_tile false --protected false
|
|
ynh_permission_update --permission dev --add $admin_user --label "New tile" --protected true --show_tile true
|
|
|
|
ynh_permission_url --permission admin --clear_urls --auth_header false
|
|
|
|
if [[ "$domain" == "$domain_2" ]]
|
|
then
|
|
url_for_domain_2=""
|
|
else
|
|
url_for_domain_2="$domain_2/"
|
|
ynh_permission_url --permission dev --remove_url $url_for_domain_2 --auth_header true
|
|
fi
|
|
|
|
ynh_permission_url --permission test --url "/mytest" --add_url "/otherTest" "$domain_2/bob"
|