From c1e979689d2e2366c52aa6b86fe2f1e579ff625b Mon Sep 17 00:00:00 2001 From: tituspijean Date: Sun, 9 Jul 2023 00:22:20 +0200 Subject: [PATCH] Fix API permission for clients --- scripts/install | 2 +- scripts/upgrade | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index 848df74..b3b07a8 100644 --- a/scripts/install +++ b/scripts/install @@ -211,7 +211,7 @@ then ynh_permission_update --permission="main" --add="visitors" fi -ynh_permission_create --permission="api" --url="/api" --additional_urls="/identity/connect/token" --allowed="visitors" --auth_header="false" --show_tile="false" --protected="true" +ynh_permission_create --permission="api" --url="/api" --additional_urls="/identity" --allowed="visitors" --auth_header="false" --show_tile="false" --protected="true" ynh_permission_create --permission="admin" --url="/admin" --allowed="$admin" --show_tile="false" #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 7df7129..68fde7a 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -109,7 +109,9 @@ fi # Create a permission if needed if ! ynh_permission_exists --permission="api"; then - ynh_permission_create --permission="api" --url="/api" --additional_urls="/identity/connect/token" --allowed="visitors" --auth_header="false" --show_tile="false" --protected="true" + ynh_permission_create --permission="api" --url="/api" --additional_urls="/identity" --allowed="visitors" --auth_header="false" --show_tile="false" --protected="true" +else + ynh_permission_url --permission="api" --remove_url="/identity/connect/token" --add_url="/identity" fi # If datadir doesn't exist, create it