make settings button invisible if you don't have permission to manage settings

This commit is contained in:
Kenneth Kehl
2024-07-16 13:01:12 -07:00
parent 5a2ab02da6
commit bf556eb408
4 changed files with 20 additions and 24 deletions

View File

@@ -24,11 +24,15 @@ from app.utils.user_permissions import (
def _get_service_id_from_view_args():
return str(request.view_args.get("service_id", "")) or None
if request and request.view_args:
return str(request.view_args.get("service_id", ""))
return None
def _get_org_id_from_view_args():
return str(request.view_args.get("org_id", "")) or None
if request and request.view_args:
return str(request.view_args.get("org_id", ""))
return None
class User(JSONModel, UserMixin):
@@ -228,7 +232,7 @@ class User(JSONModel, UserMixin):
# we shouldn't have any pages that require permissions, but don't specify a service or organization.
# use @user_is_platform_admin for platform admin only pages
# raise NotImplementedError
print(f"VIEW ARGS ARE {request.view_args}")
current_app.logger.warn(f"VIEW ARGS ARE {request.view_args}")
pass
log_msg = f"has_permissions user: {self.id} service: {service_id}"

View File

@@ -68,15 +68,7 @@ class NotifyAdminAPIClient(BaseAPIClient):
):
still_signing_in = True
print(f"HERE IS ARG {arg}")
if arg == ():
print("ARG WAS EMPTY TUPLE")
elif not arg:
print("ARG WAS NOT")
elif len(arg[0]) == 0:
print("arg0 was len 0")
elif str(arg) == "()":
print("string arg was ()")
if str(arg) == "()":
still_signing_in = True
# TODO: Update this once E2E tests are managed by a feature flag or some other main config option.
if os.getenv("NOTIFY_E2E_TEST_EMAIL"):