test_apps/permissions_app_ynh/scripts/upgrade
Josué Tille 7b967f473d
Add more test for permission helper
- Add more test of helper 'ynh_permission_update'
- Add test of permission protection feature
2019-12-27 15:49:33 +01:00

22 lines
628 B
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)
#=================================================
# UPDATE PERMISSIONS
#=================================================
ynh_permission_update --permission admin --remove $admin_user --protected false
ynh_permission_update --permission dev --add $admin_user --protected true