Fix displaying first service/invoice/account for user

This commit is contained in:
Deon George 2020-05-25 13:57:36 +10:00
parent 4935a9f5ff
commit 589aeb7289
No known key found for this signature in database
GPG Key ID: 7670E8DC27415254
3 changed files with 3 additions and 3 deletions

View File

@ -21,7 +21,7 @@ class AccountPolicy
public function view(User $user, Account $o)
{
// If this is a service for an account managed by a user.
return ($user->accounts->pluck('id')->search($o->id))
return ($user->accounts->pluck('id')->search($o->id) !== FALSE)
// The user is the wholesaler
OR $user->isWholesaler()

View File

@ -21,7 +21,7 @@ class InvoicePolicy
public function view(User $user, Invoice $o)
{
// If this is a service for an account managed by a user.
return ($user->invoices->pluck('id')->search($o->id))
return ($user->invoices->pluck('id')->search($o->id) !== FALSE)
// The user is the wholesaler
OR $user->isWholesaler()

View File

@ -21,7 +21,7 @@ class ServicePolicy
public function view(User $user, Service $o)
{
// If this is a service for an account managed by a user.
return ($user->services->pluck('id')->search($o->id))
return ($user->services->pluck('id')->search($o->id) !== FALSE)
// The user is the wholesaler
OR $user->isWholesaler()