def fetch_resource(self, resource_id, user_agent=None, stream=True):
        """Fetches a single resource from filestore.

        Args:
            resource_id (str): The filestore resource id.

        Kwargs:
            user_agent (str): The user agent.
            stream (bool): Stream content (default: True).

        Returns:
            obj: requests.Response object.

        Raises:
            NotFound: If unable to find the resource.
            NotAuthorized: If access to fetch resource is denied.

        Examples:
            >>> CKAN(quiet=True).fetch_resource('rid')
            Traceback (most recent call last):
            NotFound: Resource `rid` was not found in filestore.
        """
        user_agent = user_agent or self.user_agent
        err_msg = 'Resource `%s` was not found in filestore.' % resource_id

        try:
            resource = self.resource_show(id=resource_id)
        except NotFound:
            raise NotFound(err_msg)
        except ValidationError as err:
            if err.error_dict.get('resource_id') == ['Not found: Resource']:
                raise NotFound(err_msg)
            else:
                raise err

        url = resource.get('perma_link') or resource.get('url')

        if self.verbose:
            print('Downloading url %s...' % url)

        headers = {'User-Agent': user_agent}
        r = requests.get(url, stream=stream, headers=headers)
        err_msg = 'Access to fetch resource %s was denied.' % resource_id

        if any('403' in h.headers.get('x-ckan-error', '') for h in r.history):
            raise NotAuthorized(err_msg)
        elif r.status_code == 401:
            raise NotAuthorized(err_msg)
        else:
            return r