Refactor recipe editing logic to use User's method for permission check and update template accordingly
This commit is contained in:
parent
be6905cc3b
commit
c296689c6b
4 changed files with 9 additions and 7 deletions
|
|
@ -6,7 +6,7 @@
|
|||
<h2 class="recipe-title" >{{ recipe.title }}</h2>
|
||||
|
||||
{% if let Some(user) = context.user %}
|
||||
{% if crate::data::model::can_user_edit_recipe(user, recipe) %}
|
||||
{% if user.can_edit_recipe(recipe) %}
|
||||
<a class="edit-recipe button" href="/{{ context.tr.current_lang_code() }}/recipe/edit/{{ recipe.id }}" >Edit</a>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue