{% extends 'LigiBundle::layout.html.twig' %}

{% block title %}{{ entity.name }}{% endblock title %}

{% block body -%}
  <h1 class="ui dividing header">{{ entity.name }}</h1>

  <div class="ui rounded right floated medium image">
    {% if entity.files|length > 0 %}
      <img src="{{ entity.files[0].path|basename|imagine_filter('thumbnail') }}" />
    {% endif %}
  </div>

  <p>
    {{ entity.description }}
  </p>

  <div class="ui clearing divider"></div>

  <a class="ui blue button" href="{{ path('ligi_item_edit', { 'id': entity.id }) }}">
    {% trans %}Edit{% endtrans %}
  </a>

{% endblock %}

{% extends 'LigiBundle::layout.html.twig' %}

{% block title %}{{ entity.name }}{% endblock title %}

{% block body -%}
  <h1 class="ui dividing header">{{ entity.name }}</h1>

  <div class="ui rounded right floated medium image">
    {% if entity.files|length > 0 %}
      <img src="{{ entity.files[0].path|basename|imagine_filter('thumbnail') }}" />
    {% endif %}
  </div>

  <p>
    {{ entity.description }}
  </p>

  <div class="ui clearing divider"></div>

  {% if (is_granted('ROLE_USER') and (not (app.user is null)) and (app.user.username == entity.createdBy))  %}
    <a class="ui blue button" href="{{ path('ligi_item_edit', { 'id': entity.id }) }}">
      {% trans %}Edit{% endtrans %}
    </a>
  {% endif %}

{% endblock %}

Add a permission check for the button.
Add a permission check for the button.
