From e964ab3069301ad944bda61cb8a39ad4665d1135 Mon Sep 17 00:00:00 2001 From: Michael Collins <15347726+michaeljcollinsuk@users.noreply.github.com> Date: Tue, 30 Jan 2024 15:40:21 +0000 Subject: [PATCH 1/5] Fix UI bugs to allow users to register apps - Update rules to allow app admin to create Auth0 clients - Display the Webapps nav button to all users, so they have access to the register app button --- controlpanel/api/rules.py | 2 +- controlpanel/frontend/jinja2/base.html | 1 - controlpanel/frontend/jinja2/webapp-detail.html | 2 +- tests/api/permissions/test_app_permissions.py | 4 ++-- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/controlpanel/api/rules.py b/controlpanel/api/rules.py index 939d5f31a..7d19478f5 100644 --- a/controlpanel/api/rules.py +++ b/controlpanel/api/rules.py @@ -50,7 +50,7 @@ def is_app_admin(user, obj): add_perm("api.list_app", is_authenticated) add_perm("api.create_app", is_authenticated) add_perm("api.retrieve_app", is_authenticated & is_app_admin) -add_perm("api.update_app", is_authenticated & is_superuser) +add_perm("api.update_app", is_authenticated & is_app_admin) add_perm("api.destroy_app", is_authenticated & is_superuser) add_perm("api.add_app_customer", is_authenticated & is_app_admin) add_perm("api.remove_app_customer", is_authenticated & is_app_admin) diff --git a/controlpanel/frontend/jinja2/base.html b/controlpanel/frontend/jinja2/base.html index 5f1b0181e..4304d9e67 100644 --- a/controlpanel/frontend/jinja2/base.html +++ b/controlpanel/frontend/jinja2/base.html @@ -107,7 +107,6 @@ "active": page_name == "webapp-datasource-list", }, { - "hide": not request.user.userapps.filter(is_admin=True).exists(), "text": "Webapps", "href": url("list-apps"), "active": page_name == "webapps", diff --git a/controlpanel/frontend/jinja2/webapp-detail.html b/controlpanel/frontend/jinja2/webapp-detail.html index 99155982d..cb94acff2 100644 --- a/controlpanel/frontend/jinja2/webapp-detail.html +++ b/controlpanel/frontend/jinja2/webapp-detail.html @@ -90,7 +90,7 @@
It appears this deployment environment is redundant and can be removed