Commit ba9ab238 authored by Brian Hatchet's avatar Brian Hatchet
Browse files

Ignoring entities that don't support the methods used by permissions

parent cefccd1c
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -75,6 +75,14 @@ class Permissions implements \JsonSerializable
    public function calculate(array $entities = []): void
    {
        foreach ($entities as $entity) {
            if (
                !method_exists($entity, 'getOwnerObj')
                && !method_exists($entity, 'getOwner')) {
                continue;
            }
            if (!method_exists($entity, 'getOwnerGuid')) {
                continue;
            }
            if ($entity) {
                $this->entities[$entity->getGuid()] = $this->getRoleForEntity($entity);
            }