Skip to content

Commit

Permalink
Change permissions to withdraw to just being an applicant
Browse files Browse the repository at this point in the history
Based on Review in #3298, the decision was made that an applicant can
withdraw at any time, without edit permissions, and edit permissions
should not be to applicants for their own submissions.

Issue #3296
  • Loading branch information
Frank Duncan authored and frjo committed Aug 7, 2024
1 parent 1c012de commit b713239
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,12 @@ <h5>{% blocktrans with stage=object.previous.stage %}Your {{ stage }} applicatio
{% trans "Delete" %}
</a>
{% endif %}
{% if request.user|has_edit_perm:object %}
{% if request.user.is_applicant %}
<a
class="link link--withdraw-submission is-active"
href="{% url 'funds:submissions:withdraw' object.id %}">
{% trans "Withdraw" %}
</a>
{% endif %}
{% if ENABLE_SUBMISSION_WITHDRAWAL and request.user.is_applicant %}
<a
class="link link--withdraw-submission is-active"
href="{% url 'funds:submissions:withdraw' object.id %}">
{% trans "Withdraw" %}
</a>
{% endif %}
{% if request.user|has_edit_perm:object %}
<a
Expand Down
2 changes: 1 addition & 1 deletion hypha/apply/funds/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1596,7 +1596,7 @@ def withdraw(self, request, *args, **kwargs):

obj = self.get_object()

if not obj.phase.permissions.can_edit(request.user):
if not request.user.is_applicant:
raise PermissionDenied

withdraw_actions = [action for action in obj.workflow[obj.status].transitions.keys() if 'withdraw' in action]
Expand Down
2 changes: 1 addition & 1 deletion hypha/apply/funds/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ def make_permissions(edit=None, review=None, view=None):
"display": _("Need screening"),
"public": _("Application Received"),
"stage": RequestExt,
"permissions": applicant_edit_permissions,
"permissions": default_permissions,
},
"ext_more_info": {
"transitions": {
Expand Down
1 change: 0 additions & 1 deletion hypha/static_src/sass/custom/_custom.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
.link--withdraw-submission {
margin-right: 1rem;
padding-right: 1rem;
border-right: 2px solid #cfcfcf;
font-weight: 700;
}

0 comments on commit b713239

Please sign in to comment.