Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[SecurityBundle] fix service class by adding a parameter, on twig extension#2835
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
stof commentedDec 10, 2011
First thing, you could overwrite the extension at the twig level by simply registering another twig extension with the same And second point, replacing core Twig functions is probably one of the best way to forbid you to use third party bundles as the change will also impact their code. Do you really need to do it (especially considering that this function simply calls the security context and all the logic is in the context) ? |
juliendidier commentedDec 10, 2011
Yes, overriding |
Commits-------60ebaaa [SecurityBundle] fix service class by adding a parameter, on twig extensionDiscussion----------[SecurityBundle] fix service class by adding a parameter, on twig extensionBug fix: noFeature addition: noBackwards compatibility break: noSymfony2 tests pass: yesFixes the following tickets: -Todo: -To override the is_granted twig function, the class of TwigExtension is now set in a parameter.---------------------------------------------------------------------------by stof at 2011/12/10 10:38:38 -0800First thing, you could overwrite the extension at the twig level by simply registering another twig extension with the same ``getName`` method.And second point, replacing core Twig functions is probably one of the best way to forbid you to use third party bundles as the change will also impact their code. Do you really need to do it (especially considering that this function simply calls the security context and all the logic is in the context) ?---------------------------------------------------------------------------by juliendidier at 2011/12/10 15:43:08 -0800Yes, overriding ```is_granted``` function is probably a bad example. But having it set as parameter allow you to redefine it (if you know what you are doing).
Bug fix: no
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -
Todo: -
To override the is_granted twig function, the class of TwigExtension is now set in a parameter.