added model check to api show endpoints

This commit is contained in:
Denis Duliçi
2022-07-20 10:54:13 +03:00
parent ef24b51142
commit fa9be87e37
9 changed files with 37 additions and 0 deletions

View File

@ -39,6 +39,10 @@ class Dashboards extends ApiController
try {
$dashboard = Dashboard::with('widgets')->find($id);
if (! $dashboard instanceof Dashboard) {
return $this->errorInternal('No query results for model [' . Dashboard::class . '] ' . $id);
}
// Check if user can access dashboard
$this->canAccess($dashboard);