From 06485f1cb3898dbcac32bb62479fda70b9ea34fc Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Thu, 2 Feb 2017 22:59:14 +0200 Subject: [PATCH] Fix issue when non-admin user views invoice with gateway limits --- app/Models/EntityModel.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Models/EntityModel.php b/app/Models/EntityModel.php index ef6322f9ab..6bc0c5b290 100644 --- a/app/Models/EntityModel.php +++ b/app/Models/EntityModel.php @@ -158,7 +158,7 @@ class EntityModel extends Eloquent } } - if (Auth::check() && ! Auth::user()->hasPermission('view_all') && $this->getEntityType() != ENTITY_TAX_RATE) { + if (Auth::check() && ! Auth::user()->hasPermission('view_all') && method_exists($this, 'getEntityType') && $this->getEntityType() != ENTITY_TAX_RATE) { $query->where(Utils::pluralizeEntityType($this->getEntityType()) . '.user_id', '=', Auth::user()->id); }