Fix for duplicate invitations
This commit is contained in:
parent
572e307362
commit
153e223010
1 changed files with 6 additions and 2 deletions
|
|
@ -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);
|
$query->where(Utils::pluralizeEntityType($this->getEntityType()) . '.user_id', '=', Auth::user()->id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -476,7 +480,7 @@ class EntityModel extends Eloquent
|
||||||
if ($entity) {
|
if ($entity) {
|
||||||
$configPath = "modules.relations.$entity.$method";
|
$configPath = "modules.relations.$entity.$method";
|
||||||
|
|
||||||
|
|
||||||
if (config()->has($configPath)) {
|
if (config()->has($configPath)) {
|
||||||
$function = config()->get($configPath);
|
$function = config()->get($configPath);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue