January 2012
2 posts
2 tags
Symfony2 Security Voters
I answered this question on StackOverflow today that is probably worth repeating here. The poster was asking how to implement subscription-based authorization logic in Symfony2. I imagine he models his problem something like this: class Subscription { const SECURED_AREA_FOO = 'FOO'; const SECURED_AREA_BAR = 'BAR'; // ... /** @ManyToOne(targetEntity="User",...
Jan 17th
10 notes
1 tag
Twig Node Visitors (Part 2)
This is the second in a series of articles on Twig node visitors. Please read part one first. Node visitors can be used for any number of things. The Twig_NodeVisitorInterface interface itself is just three methods: interface Twig_NodeVisitorInterface { /** * @return Twig_NodeInterface The modified node */ function enterNode(Twig_NodeInterface $node, Twig_Environment...
Jan 7th
2 notes