From e254cf3833386e896d8997db6550a0418802c137 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Fri, 5 Oct 2018 20:17:31 +1000 Subject: [PATCH] Fix for document permissions (#2415) --- 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 c4445d67445a..10e170f2d244 100644 --- a/app/Models/EntityModel.php +++ b/app/Models/EntityModel.php @@ -179,7 +179,7 @@ class EntityModel extends Eloquent } } - if (Auth::check() && method_exists($this, 'getEntityType') && ! Auth::user()->hasPermission('view_' . $this->getEntityType()) && $this->getEntityType() != ENTITY_TAX_RATE) { + if (Auth::check() && method_exists($this, 'getEntityType') && ! Auth::user()->hasPermission('view_' . $this->getEntityType()) && $this->getEntityType() != ENTITY_TAX_RATE && $this->getEntityType() != ENTITY_DOCUMENT) { $query->where(Utils::pluralizeEntityType($this->getEntityType()) . '.user_id', '=', Auth::user()->id); }