Permalink
Browse files

Check for permissions in template

  • Loading branch information...
1 parent ec6c7a2 commit 762e46eafdab47a1e8c1d7309fdaf49d4017ba0c @guaq guaq committed Sep 30, 2013
Showing with 23 additions and 14 deletions.
  1. +23 −14 membership/templates/membership/membership_edit_inline.html
View
37 membership/templates/membership/membership_edit_inline.html
@@ -36,30 +36,39 @@
<hr />
<h2>{% trans "Actions" %}</h2>
-{% if membership.status == "P" or membership.status == "A" %}
- <a href="{% url services.views.alias_add_for_member membership.id %}">{% trans "Add an alias" %}</a>
+{% if perms.services.manage_aliases %}
+ {% if membership.status == "P" or membership.status == "A" %}
+ <a href="{% url services.views.alias_add_for_member membership.id %}">{% trans "Add an alias" %}</a>
+ {% endif %}
{% endif %}
-{% if membership.status == "A" %}
- <a href="{% url membership_request_dissociation membership.id %}">{% trans "Request dissociation" %}</a>
-{% endif %}
+{% if perms.membership.request_dissociation_for_member %}
+ {% if membership.status == "A" %}
+ <a href="{% url membership_request_dissociation membership.id %}">{% trans "Request dissociation" %}</a>
+ {% endif %}
-{% if membership.status == "S" %}
- <a href="{% url membership_cancel_dissociation_request membership.id %}">{% trans "Cancel dissociation request" %}</a>
+ {% if membership.status == "S" %}
+ <a href="{% url membership_cancel_dissociation_request membership.id %}">{% trans "Cancel dissociation request" %}</a>
+ {% endif %}
{% endif %}
-{% if membership.status == "A" or membership.status == "S" %}
- <a href="{% url membership_dissociate membership.id %}">{% trans "Dissociate" %}</a>
+
+{% if perms.membership.dissociate_members %}
+ {% if membership.status == "A" or membership.status == "S" %}
+ <a href="{% url membership_dissociate membership.id %}">{% trans "Dissociate" %}</a>
+ {% endif %}
{% endif %}
-{% if membership.status != "D" %}
+{% if perms.membership.delete_members and membership.status != "D" %}
<a href="{% url membership_delete membership.id %}">{% trans "Delete" %}</a>
{% endif %}
-{% if membership.status == "A" and not membership.organization %}
- <a href="{% url membership_convert_to_organization membership.id %}">
- {% trans "Convert to an organization" %}
- </a>
+{% if perms.membership.manage_members %}
+ {% if membership.status == "A" and not membership.organization %}
+ <a href="{% url membership_convert_to_organization membership.id %}">
+ {% trans "Convert to an organization" %}
+ </a>
+ {% endif %}
{% endif %}

0 comments on commit 762e46e

Please sign in to comment.