Added various permission checks for links

This commit is contained in:
David Taylor
2015-05-26 03:17:20 +01:00
parent c844fe8b34
commit 67f8ae9fc7
4 changed files with 19 additions and 7 deletions

View File

@@ -33,7 +33,7 @@
</td>
<td>
<h4>
<a href="{% url 'event_detail' event.pk %}">{{ event.name }}</a>
<a {% if perms.RIGS.view_event %}href="{% url 'event_detail' event.pk %}" {% endif %}>{{ event.name }}</a>
{% if event.venue %}
<small>at {{ event.venue }}</small>
{% endif %}

View File

@@ -10,7 +10,7 @@
</p>
</div>
<div class="row">
<div class="col-sm-6">
<div class="col-sm-{% if perms.RIGS.view_event %}6{% else %}12{% endif %}">
<div class="panel panel-default">
<div class="panel-heading">
@@ -19,7 +19,7 @@
<div class="list-group">
<a class="list-group-item" href="{% url 'rigboard' %}"><span class="glyphicon glyphicon-list"></span> Rigboard</a>
<a class="list-group-item" href="{% url 'web_calendar' %}"><span class="glyphicon glyphicon-calendar"></span> Calendar</a>
<a class="list-group-item" href="{% url 'event_create' %}"><span class="glyphicon glyphicon-plus"></span> New Event</a>
{% if perms.RIGS.add_event %}<a class="list-group-item" href="{% url 'event_create' %}"><span class="glyphicon glyphicon-plus"></span> New Event</a>{% endif %}
<div class="list-group-item default"></div>
@@ -68,9 +68,11 @@
</div>
</div>
</div>
{% if perms.RIGS.view_event %}
<div class="col-sm-6" >
{% include 'RIGS/activity_feed.html' %}
</div>
{% endif %}
</div>
{% endblock %}

View File

@@ -8,11 +8,14 @@
<div class="row">
<div class="col-sm-10">
<h3>Rigboard</h3>
</div>
</div>
{% if perms.RIGS.add_event %}
<div class="col-sm-2">
<a href="{% url 'event_create' %}" class="btn btn-default pull-right">New <span
class="glyphicon glyphicon-plus"></span></a>
</div>
{% endif %}
{% comment %}
{# Bring search back at a later date #}
<div class="col-sm-3 col-sm-offset-9">