Browse Source

Check ACL before displaying destroy button

Rafał Pitoń 11 years ago
parent
commit
b45c511402
1 changed files with 2 additions and 0 deletions
  1. 2 0
      templates/cranefly/profiles/profile.html

+ 2 - 0
templates/cranefly/profiles/profile.html

@@ -66,6 +66,7 @@
               <a href="{{ url('private_thread_start_with', username=profile.username_slug, user=profile.pk) }}" class="btn btn-icon tooltip-top" title="{% trans user=profile.username %}Start private thread with {{ user }}{% endtrans %}"><i class="icon-envelope"></i></a>
               <a href="{{ url('private_thread_start_with', username=profile.username_slug, user=profile.pk) }}" class="btn btn-icon tooltip-top" title="{% trans user=profile.username %}Start private thread with {{ user }}{% endtrans %}"><i class="icon-envelope"></i></a>
             </li>
             </li>
             {% endif %}
             {% endif %}
+            {% if acl.destroy_users.can_destroy_user(profile) %}
             <li class="pull-right">
             <li class="pull-right">
               <form class="form-inline form-destroy-user" action="{{ url('destroy_user', username=profile.username_slug, user=profile.pk) }}" method="post">
               <form class="form-inline form-destroy-user" action="{{ url('destroy_user', username=profile.username_slug, user=profile.pk) }}" method="post">
                 <input type="hidden" name="{{ csrf_id }}" value="{{ csrf_token }}">
                 <input type="hidden" name="{{ csrf_id }}" value="{{ csrf_token }}">
@@ -75,6 +76,7 @@
               </form>
               </form>
             </li>
             </li>
             {% endif %}
             {% endif %}
+            {% endif %}
           </ul>
           </ul>
         </div>
         </div>
       </div>
       </div>