Update BaseAPIController.php

This commit is contained in:
David Bomba 2018-07-22 13:22:38 +10:00 committed by GitHub
parent 6b377e6610
commit 942b06f999
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -116,7 +116,7 @@ class BaseAPIController extends Controller
$query->whereHas('client', $filter); $query->whereHas('client', $filter);
} }
if (! Utils::hasPermission('admin')) { if (! Utils::hasPermission('view_'.$this->entityType)) {
if ($this->entityType == ENTITY_USER) { if ($this->entityType == ENTITY_USER) {
$query->where('id', '=', Auth::user()->id); $query->where('id', '=', Auth::user()->id);
} else { } else {