News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Joshua Thijssen's Blog:
Symfony2 Implementing ACL rules in your Data Fixtures
July 04, 2012 @ 16:33:23

Joshua Thijssen has a new post to his blog looking at a method for setting up ACL rules in fixtures for your Symfony2-based applications.

Doctrine's DataFixtures are a great way to add test data to your application. It's fairly easy to get this going: Create a fixureLoader that extends DoctrineCommonDataFixturesAbstractFixture, had a load() method and off you go. However, sometimes you want your data also to be protected by Symfony 2′s ACL layer. Since there isn't a common way to do this, here is one way on how I implemented this.

His method uses the ContainerAware interface on the fixture loader instance to be able to get at the container for the fixture. This allows you to use the usual ACL handling methods of the framework to provide restrictions based on things like usernames and roles.

0 comments voice your opinion now!
symfony2 fixture acl rule container loader tutorial


blog comments powered by Disqus

Similar Posts

DZone.com: Sencha Touch 2 Models - Loading And Saving Model Data Using a Proxy, PHP Example

Shameer's Blog: PHP 5.3 : Practical look into Lambda functions and closures

NETTUTS.com: Twitter Emulation Using MooTools 1.2 and PHP

Giorgio Sironi's Blog: HTTP verbs in PHP

ServerGrove Blog: How to setup multiple PHP versions on Apache


Community Events





Don't see your event here?
Let us know!


language opinion symfony library series podcast package community unittest release install bugfix framework api zendserver laravel introduction voicesoftheelephpant interview deployment

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework