Fix for duplicate invitations

This commit is contained in:
Hillel Coren 2019-02-25 12:42:14 +02:00
parent 3e8565bd70
commit 9dd1462d65

View File

@ -179,7 +179,11 @@ class EntityModel extends Eloquent
} }
} }
if (Auth::check() && method_exists($this, 'getEntityType') && ! Auth::user()->hasPermission('view_' . $this->getEntityType()) && $this->getEntityType() != ENTITY_TAX_RATE && $this->getEntityType() != ENTITY_DOCUMENT) { if (Auth::check() && method_exists($this, 'getEntityType')
&& ! Auth::user()->hasPermission('view_' . $this->getEntityType())
&& $this->getEntityType() != ENTITY_TAX_RATE
&& $this->getEntityType() != ENTITY_TICKET
&& $this->getEntityType() != ENTITY_INVITATION) {
$query->where(Utils::pluralizeEntityType($this->getEntityType()) . '.user_id', '=', Auth::user()->id); $query->where(Utils::pluralizeEntityType($this->getEntityType()) . '.user_id', '=', Auth::user()->id);
} }