protected function loadAuthorizeObject($id, $action)
    {
        $model = $this->getRepository()->findById($id, [], app('context'));
        if (empty($model)) {
            throw new NotFoundHttpException("Object ($id) not found");
        }
        if (!$model->isAllowed($action)) {
            throw new AccessDeniedHttpException("Forbidden");
        }
        return $model;
    }