From 9dd1462d6503b1b6181edddf703c86487c3f2051 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Mon, 25 Feb 2019 12:42:14 +0200 Subject: [PATCH] Fix for duplicate invitations --- app/Models/EntityModel.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/Models/EntityModel.php b/app/Models/EntityModel.php index 10e170f2d244..5610fc2f91b5 100644 --- a/app/Models/EntityModel.php +++ b/app/Models/EntityModel.php @@ -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); }