From 4eeca9f6922bf725e30c537c3b8c1b65a51d8c81 Mon Sep 17 00:00:00 2001 From: Jimmy Monin Date: Mon, 27 Apr 2020 23:09:52 +0200 Subject: [PATCH] Use new permission system --- scripts/install | 9 +++++---- scripts/upgrade | 8 +++++--- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/scripts/install b/scripts/install index 7be2ea3..9003a7e 100644 --- a/scripts/install +++ b/scripts/install @@ -109,14 +109,15 @@ cp ../conf/app.src /opt/netdata/etc/netdata # SETUP SSOWAT #================================================= -# If app is public, add url to SSOWat conf as skipped_uris +# 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" unprotected_uris "/" + # Everyone can access the app. + # The "main" permission is automatically created before the install script. + ynh_permission_update --permission "main" --add "visitors" fi # Add direct access in the portal to admin only -yunohost app addaccess --users=$admin $app +ynh_permission_update --permission "main" --add "$admin" #================================================= # RELOAD NGINX diff --git a/scripts/upgrade b/scripts/upgrade index bf18c94..bfcd2e2 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -115,10 +115,12 @@ cp ../conf/app.src /opt/netdata/etc/netdata #================================================= # SETUP SSOWAT #================================================= -# If app is public, add url to SSOWat conf as skipped_uris + +# Make app public if necessary if [[ $is_public -eq 1 ]]; then - # See install script - ynh_app_setting_set "$app" unprotected_uris "/" + # Everyone can access the app. + # The "main" permission is automatically created before the install script. + ynh_permission_update --permission "main" --add "visitors" fi #=================================================