Suppose a scenario like below :
Class User {} // User has Admin Role
Class Role {} // Role Admin has Access to choose_date
Class Feature {} // Feature route is choose_date
Each User can have One Role. Each role has access to many Features. I have designed the part that Save and Retrieve the Access Matrix for each role. So I know which Role should access to which features and it is saved in a table called roles_features.
Do I have to write my own function to check if the rout is allowed for that Role or not manually. Note: I don’t want to use secuirty.yml file at all;
// In my Twig File
{% if my_own_get_access_matrix(app.user.roles, 'choose_date') %}
<a href="{{ path('choose_date') }}">
Edit
</a>
{% endif %}
I would like to know if there exists any predefined my_own_get_access_matrix which return an optimized way of Access Control for each Role and Links or I have to implement mine;
As I wrote, I don’t want to use the secuirity.yml since Access Control need to be dynamic. So a super user (ADMIN) should be able to define Roles and their Access to Each Feature which is a Route here;
Thanks in advance.
It looks like you’re looking for ACLs.