From 153e223010ba845eb167a9bdd66cd3501f15d44a Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Mon, 25 Feb 2019 12:38:52 +0200 Subject: [PATCH] Fix for duplicate invitations --- app/Models/EntityModel.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/Models/EntityModel.php b/app/Models/EntityModel.php index 26b95093d16b..fb17ac2a5934 100644 --- a/app/Models/EntityModel.php +++ b/app/Models/EntityModel.php @@ -192,7 +192,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_TICKET) { + 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); } @@ -476,7 +480,7 @@ class EntityModel extends Eloquent if ($entity) { $configPath = "modules.relations.$entity.$method"; - + if (config()->has($configPath)) { $function = config()->get($configPath);