digitalstate/platform-security-bundle

数字状态安全包

安装: 149

依赖项: 0

建议者: 0

安全: 0

星星: 0

关注者: 4

分支: 1

类型:symfony-bundle

0.3.0 2017-02-21 00:36 UTC

This package is not auto-updated.

Last update: 2024-09-14 19:53:17 UTC


README

安全包扩展了 OroSecurityBundle 并为开发者提供了额外的核心安全功能。

Code Climate Test Coverage

目录

迁移扩展

此包引入了一个方便的 迁移扩展,用于帮助加载基于 yml 的 acl 数据存根。

示例:

<?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 ]

待办事项