Open aeneasr opened 10 years ago
Ping @jmleroux, @danizord, @bakura10, @ocramius ?
I don't like annotations ! ;) I prefer to centralize permissions in one file. This is just a personnel preference (not talking about the performance overheat to parse annotations). But i know that many people love annotations, so why not.
It coulk make sense for controller guards, or service protections. But for route guards, i definitly prefer a config file.
It's definately a feature for service protections :)
I have done some research and updated the RFC accordingly
Service protection is still a pain. It needs a lot of boilerplate code (DI,
isGranted()
) and coupling is encouraged by requiring the dev to inject theAuthorizationService
. There is something called method interception which translates to a configurable way for protecting services and classes.Here are some examples how that could work:
Array
Annotations
XML
Java is doing this and there are some frameworks out there which provide that functionality, so go ahead and give it a read:
There are already some interceptor implementations for PHP:
What do you think? Your feedback is much appreciated!