{"record":{"id":"c27da36a3099d10b","repo":"run-llama/llama_index","slug":"self-class-name-does-not-provide-get-per","errorCode":null,"errorMessage":"{self.__class__.__name__} does not provide get_permission_info method currently","messagePattern":"(.+?) does not provide get_permission_info method currently","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"llama-index-core/llama_index/core/readers/base.py","lineNumber":92,"sourceCode":"\n        \"\"\"\n\n    async def alist_resources(self, *args: Any, **kwargs: Any) -> List[str]:\n        \"\"\"\n        List of identifiers for the specific type of resources available in the reader asynchronously.\n\n        Returns:\n            List[str]: A list of resources based on the reader type, such as files for a filesystem reader,\n            channel IDs for a Slack reader, or pages for a Notion reader.\n\n        \"\"\"\n        return await asyncio.to_thread(self.list_resources, *args, **kwargs)\n\n    def get_permission_info(self, resource_id: str, *args: Any, **kwargs: Any) -> Dict:\n        \"\"\"\n        Get a dictionary of information about the permissions of a specific resource.\n        \"\"\"\n        raise NotImplementedError(\n            f\"{self.__class__.__name__} does not provide get_permission_info method currently\"\n        )\n\n    async def aget_permission_info(\n        self, resource_id: str, *args: Any, **kwargs: Any\n    ) -> Dict:\n        \"\"\"\n        Get a dictionary of information about the permissions of a specific resource asynchronously.\n        \"\"\"\n        return await asyncio.to_thread(\n            self.get_permission_info, resource_id, *args, **kwargs\n        )\n\n    @abstractmethod\n    def get_resource_info(self, resource_id: str, *args: Any, **kwargs: Any) -> Dict:\n        \"\"\"\n        Get a dictionary of information about a specific resource.\n","sourceCodeStart":74,"sourceCodeEnd":110,"githubUrl":"https://github.com/run-llama/llama_index/blob/afd0fef371831f9bda13e5af7167cf4e981278ab/llama-index-core/llama_index/core/readers/base.py#L74-L110","documentation":"BaseReader.get_permission_info(resource_id) is an optional hook returning permission details for one resource; the base class raises NotImplementedError naming the subclass. The async wrapper aget_permission_info simply forwards to it via to_thread.","triggerScenarios":"Calling reader.get_permission_info(...) or awaiting reader.aget_permission_info(...) on a reader (built-in or custom) that does not implement permission reporting — only resource permission aware readers do.","commonSituations":"Building agent/UI flows that enumerate reader permissions generically (list_resources works, then get_permission_info fails because that reader only implemented list_resources); treating the hook as mandatory.","solutions":["Guard with hasattr/inspect before calling: only call when the subclass overrides get_permission_info","Implement get_permission_info(self, resource_id) in your custom reader, returning e.g. {\"read\": True, ...}","If you control the caller, feature-detect: `type(reader).get_permission_info is not BaseReader.get_permission_info`"],"exampleFix":"// before\ninfo = reader.get_permission_info(resource_id=\"file:///data\")  # raises\n\n// after\nif type(reader).get_permission_info is not BaseReader.get_permission_info:\n    info = reader.get_permission_info(resource_id=\"file:///data\")\nelse:\n    info = {\"supported\": False}","handlingStrategy":"type-guard","validationCode":"from llama_index.core.readers.base import BaseReader\n\ndef reader_supports_permission_info(reader: BaseReader) -> bool:\n    return type(reader).get_permission_info is not BaseReader.get_permission_info\n\nif reader_supports_permission_info(reader):\n    info = reader.get_permission_info(resource_id)\nelse:\n    info = {\"supported\": False, \"resource_id\": resource_id}","typeGuard":"def is_permission_aware(reader) -> bool:\n    \"\"\"True when the subclass overrides get_permission_info.\"\"\"\n    from llama_index.core.readers.base import BaseReader\n    return (\n        isinstance(reader, BaseReader)\n        and type(reader).get_permission_info is not BaseReader.get_permission_info\n    )","tryCatchPattern":null,"preventionTips":["Treat get_permission_info as an optional capability — feature-detect before calling","In generic tool/UI layers, maintain an allowlist of permission-aware readers","Implement both list_resources and get_permission_info together in custom readers"],"tags":["reader","not-implemented","permissions","optional-hook"],"backgroundTag":null,"analyzedSha":"afd0fef371831f9bda13e5af7167cf4e981278ab","analyzedAt":"2026-08-15T05:42:58.429Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}