mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +08:00
core: restore PERM_EDIT_PROBLEM_SELF
This commit is contained in:
1 parent
5b0478fb3f
commit
866aa56f78
11 files changed
+25
-21
No files matched your search
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@hydrooj/ui-default",
|
||||
"version": "4.8.3",
|
||||
"version": "4.8.4",
|
||||
"author": "undefined <i@undefined.moe>",
|
||||
"license": "AGPL-3.0",
|
||||
"main": "hydro.js",
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
<span class="icon icon-send"></span> {{ _('Open in Problem Set') }}
|
||||
</a></li>
|
||||
{% endif %}
|
||||
{% 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) %}
|
||||
<li class="menu__seperator"></li>
|
||||
<li class="menu__item"><a class="menu__link{% if page_name == 'problem_edit' %} active{% endif %}" href="{{ url('problem_edit', pid=pdoc.pid|default(pdoc.docId)) }}">
|
||||
<span class="icon icon-edit"></span> {{ _('Edit') }}
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
<span class="icon icon-send"></span> {{ _('Open in Problem Set') }}
|
||||
</a></li>
|
||||
{% endif %}
|
||||
{% 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) %}
|
||||
<li class="menu__seperator"></li>
|
||||
<li class="menu__item"><a class="menu__link{% if page_name == 'problem_edit' %} active{% endif %}" href="{{ url('problem_edit', pid=pdoc.pid|default(pdoc.docId)) }}">
|
||||
<span class="icon icon-edit"></span> {{ _('Edit') }}
|
||||
|
||||
@@ -78,7 +78,7 @@
|
||||
<li class="menu__item"><a class="menu__link{% if page_name == 'problem_files' %} active{% endif %}" href="{{ url('problem_files', pid=pdoc.pid|default(pdoc.docId)) }}">
|
||||
<span class="icon icon-file"></span> {{ _('Files') }}
|
||||
</a></li>
|
||||
{% if (handler.user.own(pdoc) and handler.user.hasPerm(perm.PERM_EDIT_PROBLEM_SELF)) 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) %}
|
||||
<li class="menu__seperator"></li>
|
||||
<li class="menu__item"><a class="menu__link{% if page_name == 'problem_edit' %} active{% endif %}" href="{{ url('problem_edit', pid=pdoc.pid|default(pdoc.docId)) }}">
|
||||
<span class="icon icon-edit"></span> {{ _('Edit') }}
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
<button type="submit" class="rounded primary button">
|
||||
{{ _('Update') }}
|
||||
</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 name="operation" value="delete" type="submit" class="rounded button">
|
||||
{{ _('Delete') }}
|
||||
</button>
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in new issue
Block a user