Skip to content

Commit

Permalink
TP2000-1255 Correct homepage card permission (#1182)
Browse files Browse the repository at this point in the history
* Correct homepage card permission
  • Loading branch information
dalecannon authored Mar 21, 2024
1 parent fa3f064 commit 020065a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions common/jinja2/common/homepage.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@
class="govuk-button homepage-workbasket-action"
>Create a <br> workbasket</a>
</div>
{% endif %}

{% if can_edit_workbasket %}
<div class="govuk-grid-column-one-half">
<a
href="{{ url('workbaskets:workbasket-ui-list') }}"
Expand All @@ -58,7 +60,9 @@
</div>
</div>
</article>
{% endif %}

{% if can_edit_workbasket %}
<article class="homepage-card">
<h3 class="govuk-heading-m">Currently working on</h3>
{% if not assigned_workbaskets %}
Expand Down
2 changes: 1 addition & 1 deletion common/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def test_maintenance_mode_page_content(valid_user_client):
("card", "permission"),
[
("What would you like to do?", "view_workbasket"),
("Currently working on", "view_workbasket"),
("Currently working on", "change_workbasket"),
("EU TARIC files", "add_trackedmodel"),
("Envelopes", "consume_from_packaging_queue"),
("Resources", ""),
Expand Down
3 changes: 3 additions & 0 deletions common/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ def get_context_data(self, **kwargs):
"can_add_workbasket": self.request.user.has_perm(
"workbaskets.add_workbasket",
),
"can_edit_workbasket": self.request.user.has_perm(
"workbaskets.change_workbasket",
),
"can_view_reports": self.request.user.has_perm(
"reports.view_report_index",
),
Expand Down

0 comments on commit 020065a

Please sign in to comment.