PHP code example of digitalstate / platform-security-bundle

1. Go to this page and download the library: Download digitalstate/platform-security-bundle library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

digitalstate / platform-security-bundle example snippets




namespace Gov\Bundle\DemoBundle\Migrations\Data\ORM;

use Doctrine\Common\DataFixtures\AbstractFixture;
use Ds\Bundle\UserBundle\Migration\Extension\AclExtensionAwareInterface;
use Ds\Bundle\UserBundle\Migration\Extension\AclExtensionAwareTrait;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerAwareTrait;
use Doctrine\Common\Persistence\ObjectManager;

class LoadAclData extends AbstractFixture implements AclExtensionAwareInterface, ContainerAwareInterface
{
    use AclExtensionAwareTrait;
    use ContainerAwareTrait;

    public function load(ObjectManager $manager)
    {
        // Currently extensions are not automatically injected via the *AwareInterface.
        $this->setAclExtension($this->container->get('ds.security.migration.extension.acl'));
        //
        
        $resource = __DIR__.'/../../../Resources/data/acl.yml';
        $this->aclExtension->import($resource, $manager);
    }
}