mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-18 13:39:41 -04:00
Merge branch 'main' of https://github.com/GSA/notifications-admin into 1484-dashboard-visualizations
This commit is contained in:
@@ -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):
|
||||
@@ -227,7 +231,9 @@ class User(JSONModel, UserMixin):
|
||||
if not service_id and not org_id:
|
||||
# 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
|
||||
# raise NotImplementedError
|
||||
current_app.logger.warn(f"VIEW ARGS ARE {request.view_args}")
|
||||
pass
|
||||
|
||||
log_msg = f"has_permissions user: {self.id} service: {service_id}"
|
||||
# platform admins should be able to do most things (except eg send messages, or create api keys)
|
||||
|
||||
@@ -14,10 +14,17 @@
|
||||
{% endif %}
|
||||
|
||||
{% if current_service %}
|
||||
{% set secondaryNavigation = [
|
||||
{"href": url_for('main.service_settings', service_id=current_service.id), "text": "Settings", "active": secondary_navigation.is_selected('settings')},
|
||||
{% if current_user.has_permissions('manage_service') %}
|
||||
{% set secondaryNavigation = [
|
||||
{"href": url_for('main.service_settings', service_id=current_service.id), "text": "Settings", "active": secondary_navigation.is_selected('settings')},
|
||||
{"href": url_for('main.sign_out'), "text": "Sign out"}
|
||||
] %}
|
||||
{% else %}
|
||||
{% set secondaryNavigation = [
|
||||
{"href": url_for('main.sign_out'), "text": "Sign out"}
|
||||
] %}
|
||||
] %}
|
||||
|
||||
{% endif %}
|
||||
{% else %}
|
||||
{% set secondaryNavigation = [{"href": url_for('main.sign_out'), "text": "Sign out"}] %}
|
||||
{% endif %}
|
||||
|
||||
Reference in New Issue
Block a user