Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

Check for correct permission

Roland Geider0270b653ab63
diff --git a/wger/core/templates/navigation.html b/wger/core/templates/navigation.html
index 3cece8c55..7f493fd3e 100644
--- a/wger/core/templates/navigation.html
+++ b/wger/core/templates/navigation.html
@@ -104,7 +104,7 @@
<li><a href="{% url 'nutrition:ingredient:list' %}">{% trans "Ingredient overview" %}</a></li>
<li><a href="{% url 'nutrition:bmi:view' %}" rel="nofollow">{% trans "BMI calculator" %}</a></li>
<li><a href="{% url 'nutrition:calories:view' %}" rel="nofollow">{% trans "Daily calories calculator" %}</a></li>
- {% if perms.exercises %}
+ {% if perms.nutrition %}
<li class="divider"></li>
<li class="dropdown-header">{% trans "Administration" %}</li>
<li><a href="{% url 'nutrition:weight_unit:list' %}">{% trans "Ingredient weight units" %}</a></li>
diff --git a/wger/exercises/templates/exercise/view.html b/wger/exercises/templates/exercise/view.html
index 5713c1fe2..ecbdb4751 100644
--- a/wger/exercises/templates/exercise/view.html
+++ b/wger/exercises/templates/exercise/view.html
@@ -54,10 +54,10 @@
<p>{% blocktrans %}This user submitted exercise is pending a decision to be
included in the database.{% endblocktrans %}
{% trans "Till then, it will not be shown in the overview or the search." %}
- {% if perms.exercises %}{% trans "Please select one of the options below." %}{% endif %}
+ {% if perms.exercises.add_exercise %}{% trans "Please select one of the options below." %}{% endif %}
</p>
- {% if perms.exercises %}
+ {% if perms.exercises.add_exercise %}
<div class="btn-group btn-group-justified" role="group">
<a href="{% url 'exercise:exercise:accept' exercise.id %}" class="btn btn-default">
@@ -122,7 +122,7 @@
{% if images or perms.exercises.change_exerciseimage %}
<div class="row" style="margin-top:1em;">
<div class="col-xs-3">
- {% if perms.exercises %}
+ {% if perms.exercises.change_exerciseimage %}
<p>
<a href="{% url 'exercise:image:add' exercise.id %}" class="btn btn-success btn-xs">
{% trans "Add new image" %}
@@ -358,7 +358,7 @@ $(document).ready(function() {
{% endif %}
-{% if perms.exercises %}
+{% if perms.exercises.change_exercise %}
<h4>{% trans "Options" %}</h4>
<p>
<a href="{% url 'exercise:exercise:edit' exercise.id %}" {% auto_link_css flavour %}>
diff --git a/wger/nutrition/templates/ingredient/view.html b/wger/nutrition/templates/ingredient/view.html
index 599d23963..518f91010 100644
--- a/wger/nutrition/templates/ingredient/view.html
+++ b/wger/nutrition/templates/ingredient/view.html
@@ -28,10 +28,10 @@ $(document).ready(function() {
<p>{% blocktrans %}This user submitted ingredient is pending a decision to be
included in the database. Till then, it will not be shown in the overview or
the search.{% endblocktrans %}
-{% if perms.exercises %}{% trans "Please select one of the options below." %}{% endif %}
+{% if perms.nutrition.add_ingredient %}{% trans "Please select one of the options below." %}{% endif %}
</p>
-{% if perms.exercises %}
+{% if perms.nutrition.add_ingredient %}
<div class="btn-group btn-group-justified" role="group">
<a href="{% url 'nutrition:ingredient:accept' ingredient.id %}" class="btn btn-default">
<img src="{% static 'images/icons/status-on.svg' %}"
@@ -187,7 +187,7 @@ the search.{% endblocktrans %}
{% endif %}
-{% if perms.exercises %}
+{% if perms.nutrition.delete_ingredient %}
<h4>{% trans "Options" %}</h4>
<p>
diff --git a/wger/software/templates/changelog.html b/wger/software/templates/changelog.html
index f4ca2cc7b..90d9237f6 100644
--- a/wger/software/templates/changelog.html
+++ b/wger/software/templates/changelog.html
@@ -16,6 +16,7 @@
</li>
<li>
Other improvements and bugfixes
+ <a href="https://github.com/rolandgeider/wger/issues/270">#270</a>
<a href="https://github.com/rolandgeider/wger/issues/258">#258</a>
<a href="https://github.com/rolandgeider/wger/issues/257">#257</a>
</li>