Aug 25 - Fixed inspection access denied by inspector
This commit is contained in:
@@ -353,7 +353,12 @@
|
||||
<button onclick="window.print()" class="btn btn-sm btn-outline-secondary">
|
||||
<i class="bi bi-printer"></i> Print
|
||||
</button>
|
||||
{% if current_user.role not in ['customer'] %}
|
||||
{# Offered to managers, to the inspector who did this inspection, and to
|
||||
whoever the follow-up was assigned to (phase53). Not to any other
|
||||
inspector who can merely SEE it: reinspect() refuses them, and showing
|
||||
a button that fails on click is the mismatch this page just fixed. #}
|
||||
{% if current_user.role not in ['customer']
|
||||
and (is_own_inspection or owns_follow_up) %}
|
||||
<a href="{{ url_for('inspections.reinspect', inspection_id=inspection.id) }}"
|
||||
class="btn btn-sm btn-outline-primary"
|
||||
title="Start a follow-up re-inspection with the same template and facility">
|
||||
@@ -427,8 +432,10 @@
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if inspection.follow_up_note %}<br><span class="small">{{ inspection.follow_up_note }}</span>{% endif %}
|
||||
{# Re-inspection is staff work — reinspect() already refuses customers. #}
|
||||
{% if current_user.role != 'customer' %}
|
||||
{# Re-inspection is staff work — reinspect() already refuses customers —
|
||||
and among inspectors it belongs to the follow-up's OWNER. #}
|
||||
{% if current_user.role != 'customer'
|
||||
and (is_own_inspection or owns_follow_up) %}
|
||||
<div class="mt-2">
|
||||
<a href="{{ url_for('inspections.reinspect', inspection_id=inspection.id) }}"
|
||||
class="btn btn-sm btn-warning">
|
||||
|
||||
Reference in New Issue
Block a user