Skip to content

Commit b713239

Browse files
Frank Duncanfrjo
authored andcommitted
Change permissions to withdraw to just being an applicant
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
1 parent 1c012de commit b713239

File tree

4 files changed

+8
-11
lines changed

4 files changed

+8
-11
lines changed

hypha/apply/funds/templates/funds/applicationsubmission_detail.html

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -111,14 +111,12 @@ <h5>{% blocktrans with stage=object.previous.stage %}Your {{ stage }} applicatio
111111
{% trans "Delete" %}
112112
</a>
113113
{% endif %}
114-
{% if request.user|has_edit_perm:object %}
115-
{% if request.user.is_applicant %}
116-
<a
117-
class="link link--withdraw-submission is-active"
118-
href="{% url 'funds:submissions:withdraw' object.id %}">
119-
{% trans "Withdraw" %}
120-
</a>
121-
{% endif %}
114+
{% if ENABLE_SUBMISSION_WITHDRAWAL and request.user.is_applicant %}
115+
<a
116+
class="link link--withdraw-submission is-active"
117+
href="{% url 'funds:submissions:withdraw' object.id %}">
118+
{% trans "Withdraw" %}
119+
</a>
122120
{% endif %}
123121
{% if request.user|has_edit_perm:object %}
124122
<a

hypha/apply/funds/views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1596,7 +1596,7 @@ def withdraw(self, request, *args, **kwargs):
15961596

15971597
obj = self.get_object()
15981598

1599-
if not obj.phase.permissions.can_edit(request.user):
1599+
if not request.user.is_applicant:
16001600
raise PermissionDenied
16011601

16021602
withdraw_actions = [action for action in obj.workflow[obj.status].transitions.keys() if 'withdraw' in action]

hypha/apply/funds/workflow.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ def make_permissions(edit=None, review=None, view=None):
407407
"display": _("Need screening"),
408408
"public": _("Application Received"),
409409
"stage": RequestExt,
410-
"permissions": applicant_edit_permissions,
410+
"permissions": default_permissions,
411411
},
412412
"ext_more_info": {
413413
"transitions": {
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
.link--withdraw-submission {
22
margin-right: 1rem;
33
padding-right: 1rem;
4-
border-right: 2px solid #cfcfcf;
54
font-weight: 700;
65
}

0 commit comments

Comments
 (0)