This article was archived and may no longer be relevant.

Category: Architecture

Symfony 2 advanced/detached ACL

In Symfony 2 you can use advanced/detached ACL (access control layer). It’s really fast and I think well engineered. Many people use or try to use ACL tightly coupled with code. This is done not only in the Symfony framework.

You can imagine simple coupled ACL as bodyguard in club asking a person:

Advanced/detached ACL:

Using simple coupled ACL in lists/datasets for in SQL filtering is the most common thing in web development. This implementation brings some positive, but many negative things.

Positive:

Negative:

Real life example: Imagine a list of attendees to Math course with full names only. Math teacher can have rights to see an attendee list, but have no rights to view attendee details.

You can now say:

With tightly coupled ACL, I can ask:

With detached ACL:

Detached ACL is more work to implement at the start, but it is easier to add things or list rules later. It is also solving the complexity of larger ACLs.

Posted on 17th March, 2016