{"record":{"id":"3190c4802c9f7737","repo":"zed-industries/zed","slug":"not-authorized-to-read-projects","errorCode":null,"errorMessage":"not authorized to read projects","messagePattern":"not authorized to read projects","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/collab/src/db/queries/projects.rs","lineNumber":1142,"sourceCode":"                .filter(room_participant::Column::AnsweringConnectionId.eq(connection_id.id))\n                .one(tx)\n                .await?\n                .and_then(|participant| participant.role)\n        } else {\n            None\n        };\n\n        let role = role_from_room.unwrap_or(ChannelRole::Banned);\n\n        match capability {\n            Capability::ReadWrite => {\n                if !role.can_edit_projects() {\n                    return Err(anyhow!(\"not authorized to edit projects\"))?;\n                }\n            }\n            Capability::ReadOnly => {\n                if !role.can_read_projects() {\n                    return Err(anyhow!(\"not authorized to read projects\"))?;\n                }\n            }\n        }\n\n        Ok((project, role))\n    }\n\n    /// Returns the host connection for a read-only request to join a shared project.\n    pub async fn host_for_read_only_project_request(\n        &self,\n        project_id: ProjectId,\n        connection_id: ConnectionId,\n    ) -> Result<ConnectionId> {\n        self.project_transaction(project_id, |tx| async move {\n            let (project, _) = self\n                .access_project(project_id, connection_id, Capability::ReadOnly, &tx)\n                .await?;\n            project.host_connection()","sourceCodeStart":1124,"sourceCodeEnd":1160,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/collab/src/db/queries/projects.rs#L1124-L1160","documentation":"access_project resolved the caller's room role (defaulting to Banned when not a participant) and rejected a ReadOnly capability request because the role cannot even read projects. It is the read-side counterpart of the edit authorization check.","triggerScenarios":"Thrown at crates/collab/src/db/queries/projects.rs:1142 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Join the room/project to obtain a participant role with read access","Ask the host to share the project with the caller"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f4178619acd0d47ea1f76a2025c42962c6d6638c","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}