diff --git a/mo/web/org_contest.py b/mo/web/org_contest.py index 57062dc7d89c7bb7420ceedea8da105dc3aacb44..16ef2d338fc89547c3530291455844a63e649798 100644 --- a/mo/web/org_contest.py +++ b/mo/web/org_contest.py @@ -1479,7 +1479,8 @@ def org_generic_batch_points(task_id: Optional[int] = None, round_id: Optional[i ctx = get_context(round_id=round_id, hier_id=hier_id, ct_id=ct_id, task_id=task_id) round, hier_place, contest, task = ctx.round, ctx.hier_place, ctx.contest, ctx.task - if not ctx.rights.can_edit_points(): + # Základní kontrola, zda vůbec chceme akci spustit. Zbytek se kontrole uvnitř importu. + if not ctx.rights.offer_edit_points(): raise werkzeug.exceptions.Forbidden() form = BatchPointsForm() diff --git a/mo/web/templates/org_round.html b/mo/web/templates/org_round.html index 1fa42b2f4b5c09755ac75fb13988f3c9ba63897e..6afca009dc01c6deb7faf7c006cebb001d2486de 100644 --- a/mo/web/templates/org_round.html +++ b/mo/web/templates/org_round.html @@ -5,8 +5,8 @@ {% set can_manage_contest = rights.have_right(Right.manage_contest) %} {% set can_view_contestants = rights.have_right(Right.view_contestants) %} {% set can_handle_submits = rights.have_right(Right.view_submits) %} -{% set can_upload = rights.can_upload_feedback() %} -{% set can_edit_points = rights.can_edit_points() %} +{% set offer_upload = rights.offer_upload_feedback() %} +{% set offer_edit_points = rights.offer_edit_points() %} {% set can_view_statement = rights.can_view_statement() %} {% set can_add_contest = g.gatekeeper.rights_generic().have_right(Right.add_contest) %} {% set possible_rights_elsewhere = ctx.possible_rights_elsewhere() %} @@ -114,7 +114,7 @@ <a class="btn btn-default" href='{{ ctx.url_for('org_import_user') }}'>Importovat účastníky</a> <a class="btn btn-default" href='{{ ctx.url_for('org_import_org') }}'>Importovat organizátory</a> {% endif %} - {% if can_edit_points %} + {% if offer_edit_points %} <a class="btn btn-default" href='{{ ctx.url_for('org_generic_batch_points') }}'>Importovat body</a> {% endif %} {% if can_manage_round %} @@ -246,7 +246,7 @@ <th>Odevzdaná řešení <th>Maximum bodů {% if can_manage_round %}<th>Akce{% endif %} - {% if can_handle_submits or can_upload %}<th>Dávkové operace{% endif %} + {% if can_handle_submits or offer_upload %}<th>Dávkové operace{% endif %} </tr> </thead> {% for task, sol_count in task_info %} @@ -271,15 +271,15 @@ {% endif %} </div> {% endif %} - {% if can_handle_submits or can_upload %} + {% if can_handle_submits or offer_upload or offer_edit_points %} <td><div class="btn-group"> {% if can_handle_submits and task.type == TaskType.regular %} <a class="btn btn-xs btn-primary" href="{{ ctx.url_for('org_generic_batch_download', task_id=task.task_id) }}">Stáhnout ZIP</a> {% endif %} - {% if can_upload and task.type == TaskType.regular %} + {% if offer_upload and task.type == TaskType.regular %} <a class="btn btn-xs btn-default" href="{{ ctx.url_for('org_generic_batch_upload', task_id=task.task_id) }}">Nahrát ZIP</a> {% endif %} - {% if can_upload %} + {% if offer_edit_points %} <a class="btn btn-xs btn-default" href="{{ ctx.url_for('org_generic_batch_points', task_id=task.task_id) }}">Nahrát body</a> {% endif %} </div>