core: restore PERM_EDIT_PROBLEM_SELF

This commit is contained in:
undefined committed 2021-05-08 22:44:04 +08:00
1 parent 5b0478fb3f
commit 866aa56f78
11 files changed
+25 -21

No files matched your search

@@ -6,7 +6,7 @@
<div class="section__header">
<h1 class="section__title">{{ _('Testdata') }}</h1>
<div class="section__tools">
{% if handler.user.own(pdoc) or handler.user.hasPerm(perm.PERM_EDIT_PROBLEM) %}
{% if handler.user.own(pdoc, perm.PERM_EDIT_PROBLEM_SELF) or handler.user.hasPerm(perm.PERM_EDIT_PROBLEM) %}
<button class="primary rounded button" name="upload_testdata">{{ _('Add File') }}</button>
{% endif %}
</div>
@@ -55,7 +55,7 @@
{% endif %}
{% endif %}
</div>
{% if handler.user.own(pdoc) or handler.user.hasPerm(perm.PERM_EDIT_PROBLEM) %}
{% if handler.user.own(pdoc, perm.PERM_EDIT_PROBLEM_SELF) or handler.user.hasPerm(perm.PERM_EDIT_PROBLEM) %}
{% if testdata.length %}
<div class="section__body">
<button class="rounded button" name="download_selected_testdata">{{ _('Download Selected') }}</button>
@@ -70,7 +70,7 @@
<div class="section__header">
<h1 class="section__title">{{ _('Additional Files') }}</h1>
<div class="section__tools">
{% if handler.user.own(pdoc) or handler.user.hasPerm(perm.PERM_EDIT_PROBLEM) %}
{% if handler.user.own(pdoc, perm.PERM_EDIT_PROBLEM_SELF) or handler.user.hasPerm(perm.PERM_EDIT_PROBLEM) %}
<button class="primary rounded button" name="upload_file">{{ _('Add File') }}</button>
{% endif %}
</div>
@@ -117,7 +117,7 @@
{% if additional_file.length %}
<div class="section__body">
<button class="rounded button" name="download_selected_file">{{ _('Download Selected') }}</button>
{% if handler.user.own(pdoc) or handler.user.hasPerm(perm.PERM_EDIT_PROBLEM) %}
{% if handler.user.own(pdoc, perm.PERM_EDIT_PROBLEM_SELF) or handler.user.hasPerm(perm.PERM_EDIT_PROBLEM) %}
<button class="rounded button" name="remove_selected_file">{{ _('Remove Selected') }}</button>
{% endif %}
</div>