Skip to content

Commit

Permalink
Role Hierarchy should be optional. Fix issue with loader path.
Browse files Browse the repository at this point in the history
  • Loading branch information
curiosity26 committed Nov 5, 2018
1 parent 3c8b730 commit 2806f49
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion DependencyInjection/Curiosity26AclHelperExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class Curiosity26AclHelperExtension extends Extension
*/
public function load(array $configs, ContainerBuilder $container)
{
$loader = new YamlFileLoader($container, new FileLocator(['../Resources/config/']));
$loader = new YamlFileLoader($container, new FileLocator([__DIR__.'/../Resources/config/']));
$loader->load('services.yaml');
}

Expand Down
4 changes: 2 additions & 2 deletions Helper/AclManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ public function getClassAces(): array
*
* @return array|Entry[]
*/
public function getClassFieldAces(\string $field): array
public function getClassFieldAces(string $field): array
{
if (null === $this->acl) {
throw new \RuntimeException("Find or create an ACL using aclFor() first.");
Expand All @@ -378,7 +378,7 @@ public function getObjectAces(): array
*
* @return array|Entry[]
*/
public function getObjectFieldAces(\string $field): array
public function getObjectFieldAces(string $field): array
{
if (null === $this->acl) {
throw new \RuntimeException("Find or create an ACL using aclFor() first.");
Expand Down
2 changes: 1 addition & 1 deletion QueryBuilder/AclHelperQueryBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class AclHelperQueryBuilder
*/
private $registry;

public function __construct(RegistryInterface $registry, RoleHierarchyInterface $roleHierarchy = null)
public function __construct(RegistryInterface $registry, ?RoleHierarchyInterface $roleHierarchy = null)
{
$this->registry = $registry;
$this->roleHierarchy = $roleHierarchy;
Expand Down
2 changes: 1 addition & 1 deletion Resources/config/services.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
services:
Curiosity26\AclHelperBundle\QueryBuilder\AclHelperQueryBuilder:
$registry: '@Symfony\Bridge\Doctrine\RegistryInterface'
$roleHierarchy: '@Symfony\Component\Security\Core\Role\RoleHierarchyInterface'
$roleHierarchy: '@?security.role_hierarchy'
Curiosity26\AclHelperBundle\Helper\AclHelper:
arguments:
$registry: '@Symfony\Bridge\Doctrine\RegistryInterface'
Expand Down

0 comments on commit 2806f49

Please sign in to comment.