Answer the question
In order to leave comments, you need to log in
How to implement permissions in api?
I want to implement validation on frontend Vue. For example, it is that if the user has permission to manage members, then we display the "Manage" button. In symphony it would look something like this:
{% if is_granted('ROLE_MANAGE_MEMBERS') %}
{% if member %}
<a href="{{ path('members.show', {'id': member.id}) }}" class="btn btn-primary">View Member</a>
{% else %}
<a href="{{ path('members.create', {'id': user.id}) }}" class="btn btn-primary">Create Member</a>
{% endif %}
{% endif %}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question