digitalstate/platform-security-bundle

DigitalState Security Bundle

0.3.0 2017-02-21 00:36 UTC

This package is not auto-updated.

Last update: 2022-01-22 05:12:50 UTC


README

The Security bundle extends the OroSecurityBundle and provides the developers additional core security functionality.

Code Climate Test Coverage

Table of Contents

Migration Extensions

This bundle introduces a convenient migration extension to help with loading yml-based acl data fixtures.

Example:

<?php

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);
    }
}
acl:
    ROLE_CASE_MANAGER:
        Entity:DsCaseBundle:CaseEntity: [ VIEW_SYSTEM, CREATE_SYSTEM, EDIT_SYSTEM, DELETE_SYSTEM, ASSIGN_SYSTEM ]
        Entity:DsCaseStatusBundle:Status: [ VIEW_SYSTEM, CREATE_SYSTEM, EDIT_SYSTEM, DELETE_SYSTEM, ASSIGN_SYSTEM ]

Todo