Skip to content

Commit

Permalink
Adding findForbiddenPaths (#12)
Browse files Browse the repository at this point in the history
* Adding findForbiddenPaths

* Add interface method
  • Loading branch information
mattamon authored Sep 12, 2023
1 parent 43b807b commit 44c048e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Models/Element/ServiceResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
use Pimcore\Model\Document;
use Pimcore\Model\Element\ElementInterface;
use Pimcore\Model\Element\Service;
use Pimcore\Model\User;

final class ServiceResolver implements ServiceResolverInterface
{
Expand All @@ -33,4 +34,9 @@ public function getElementType(ElementInterface $element): ?string
{
return Service::getElementType($element);
}

public function findForbiddenPaths(string $type, User $user): array
{
return Service::findForbiddenPaths($type, $user);
}
}
3 changes: 3 additions & 0 deletions src/Models/Element/ServiceResolverInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
use Pimcore\Model\DataObject\AbstractObject;
use Pimcore\Model\Document;
use Pimcore\Model\Element\ElementInterface;
use Pimcore\Model\User;

interface ServiceResolverInterface
{
Expand All @@ -31,4 +32,6 @@ public function getElementById(
): Asset|Document|AbstractObject|null;

public function getElementType(ElementInterface $element): ?string;

public function findForbiddenPaths(string $type, User $user): array;
}

0 comments on commit 44c048e

Please sign in to comment.