Skip to content

Commit 14758f2

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.
1 parent 997f653 commit 14758f2

File tree

4 files changed

+3
-6
lines changed

4 files changed

+3
-6
lines changed

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,12 +102,10 @@ <h5>{% blocktrans with stage=object.previous.stage %}Your {{ stage }} applicatio
102102
<svg class="icon icon--delete"><use xlink:href="#delete"></use></svg>
103103
</a>
104104
{% endif %}
105-
{% if request.user|has_edit_perm:object %}
106-
{% if request.user.is_applicant %}
105+
{% if ENABLE_SUBMISSION_WITHDRAWAL and request.user.is_applicant %}
107106
<a class="link link--withdraw-submission is-active" href="{% url 'funds:submissions:withdraw' object.id %}">
108107
{% trans "Withdraw" %}
109108
</a>
110-
{% endif %}
111109
{% endif %}
112110
{% if request.user|has_edit_perm:object %}
113111
<a class="link link--edit-submission is-active" href="{% url 'funds:submissions:edit' object.id %}">

hypha/apply/funds/views.py

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

14331433
obj = self.get_object()
14341434

1435-
if not obj.phase.permissions.can_edit(request.user):
1435+
if not request.user.is_applicant:
14361436
raise PermissionDenied
14371437

14381438
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
@@ -363,7 +363,7 @@ def make_permissions(edit=None, review=None, view=None):
363363
'display': _('Need screening'),
364364
'public': _('Application Received'),
365365
'stage': RequestExt,
366-
'permissions': applicant_edit_permissions,
366+
'permissions': default_permissions,
367367
},
368368
'ext_more_info': {
369369
'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)