{"record":{"id":"ae416b2b37bc2f20","repo":"zed-industries/zed","slug":"guests-cannot-share-projects","errorCode":null,"errorMessage":"guests cannot share projects","messagePattern":"guests cannot share projects","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/collab/src/db/queries/projects.rs","lineNumber":63,"sourceCode":"                                .eq(connection.id as i32),\n                        )\n                        .add(\n                            room_participant::Column::AnsweringConnectionServerId\n                                .eq(connection.owner_id as i32),\n                        ),\n                )\n                .one(&*tx)\n                .await?\n                .context(\"could not find participant\")?;\n            if participant.room_id != room_id {\n                return Err(anyhow!(\"shared project on unexpected room\"))?;\n            }\n            if !participant\n                .role\n                .unwrap_or(ChannelRole::Member)\n                .can_edit_projects()\n            {\n                return Err(anyhow!(\"guests cannot share projects\"))?;\n            }\n\n            let project = project::ActiveModel {\n                room_id: ActiveValue::set(Some(participant.room_id)),\n                host_user_id: ActiveValue::set(Some(participant.user_id)),\n                host_connection_id: ActiveValue::set(Some(connection.id as i32)),\n                host_connection_server_id: ActiveValue::set(Some(ServerId(\n                    connection.owner_id as i32,\n                ))),\n                id: ActiveValue::NotSet,\n                windows_paths: ActiveValue::set(windows_paths),\n                features: ActiveValue::set(serde_json::to_string(features).unwrap()),\n            }\n            .insert(&*tx)\n            .await?;\n\n            if !worktrees.is_empty() {\n                worktree::Entity::insert_many(worktrees.iter().map(|worktree| {","sourceCodeStart":45,"sourceCodeEnd":81,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/collab/src/db/queries/projects.rs#L45-L81","documentation":"share_project checks the requesting participant's role; guests (roles below full member) are not permitted to share projects into the room. The participant's role in the target room is the input at fault.","triggerScenarios":"Thrown at crates/collab/src/db/queries/projects.rs:63 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ask the room host or a full participant to share the project","Upgrade the user's room role if guests should be allowed to share"],"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"}