protected function authorizeResource($resource)
    {
        if ($this->isEditing($resource)) {
            return $this->user()->can($resource . '.update');
        }

        return $this->user()->can($resource . '.create');
    }