From 9cc0952612cee8789b945cfe183d7414d2cabbaf Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Wed, 9 Dec 2020 17:59:17 +0100 Subject: [PATCH] Set new permissions --- scripts/install | 9 +++++---- scripts/upgrade | 12 ------------ 2 files changed, 5 insertions(+), 16 deletions(-) diff --git a/scripts/install b/scripts/install index 643ff90..3b8bf00 100755 --- a/scripts/install +++ b/scripts/install @@ -217,11 +217,12 @@ ynh_add_systemd_config --service="$app" --template="pyinventory.service" #================================================= ynh_script_progression --message="Configuring SSOwat..." -# Make app public if necessary -if [ "$is_public" -eq 1 ] +# Make app public if necessary or protect it +if [ $is_public -eq 1 ] then - # unprotected_uris allows SSO credentials to be passed anyway. - ynh_app_setting_set --app="$app" --key=unprotected_uris --value="/" + # Everyone can access the app. + # The "main" permission is automatically created before the install script. + ynh_permission_update --permission "main" --add "visitors" fi #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index afec6bf..3e53e98 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -193,18 +193,6 @@ chown -R "$app" "$log_path" chown -R "$app" "$public_path" chown -R "$app" "$final_path" -#================================================= -# SETUP SSOWAT -#================================================= -ynh_script_progression --message="Upgrading SSOwat configuration..." - -# Make app public if necessary -if [ "$is_public" -eq 1 ] -then - # unprotected_uris allows SSO credentials to be passed anyway. - ynh_app_setting_set --app="$app" --key=unprotected_uris --value="/" -fi - #================================================= # Start pyinventory via systemd #=================================================