Skip to content

Commit

Permalink
feat: check customer service group when rendering agency dashboard
Browse files Browse the repository at this point in the history
  • Loading branch information
angela-tran committed Aug 27, 2024
1 parent 76c5d10 commit 3f6846c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions benefits/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,9 @@ def index(self, request, extra_context=None):
else:
agency = TransitAgency.for_user(request.user)
session.update(request, agency=agency)

if agency is not None:
has_permission_for_in_person = agency.customer_service_group in request.user.groups.all()
context.update({"has_permission_for_in_person": has_permission_for_in_person})

return TemplateResponse(request, "admin/agency-dashboard-index.html", context)
2 changes: 2 additions & 0 deletions benefits/templates/admin/agency-dashboard-index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
{% endblock title %}

{% block content %}
{% if has_permission_for_in_person %}
<div class="row">
<div class="col-lg-12">
<h1 class="pt-0 pb-3 text-left">{{ agency.long_name }}</h1>
Expand All @@ -21,5 +22,6 @@ <h2 class="pt-0 pb-2 text-left">In-person enrollment</h2>
</div>
</div>
</div>
{% endif %}

{% endblock content %}

0 comments on commit 3f6846c

Please sign in to comment.