diff --git a/src/api/core/ciphers.rs b/src/api/core/ciphers.rs index a2daae10..749e8910 100644 --- a/src/api/core/ciphers.rs +++ b/src/api/core/ciphers.rs @@ -1491,15 +1491,16 @@ async fn get_attachment_data( }; if scope == CipherAccessScope::OrganizationAdmin { + // NotFound as in Bitwarden, the web vault then falls back to the attachment's own URL let Some(org_id) = cipher.organization_uuid.as_ref() else { - err!("Cipher is not owned by an organization") + err_code!("Cipher is not owned by an organization", Status::NotFound.code) }; if !Membership::find_confirmed_by_user_and_org(&headers.user.uuid, org_id, &conn) .await .is_some_and(|member| member.can_edit_any_collection()) || !cipher.is_write_accessible_to_user(&headers.user.uuid, scope, &conn).await { - err!("Cipher is not accessible") + err_code!("Cipher is not accessible", Status::NotFound.code) } } else if !cipher.is_accessible_to_user(&headers.user.uuid, scope, &conn).await { err!("Cipher is not accessible") diff --git a/src/api/core/organizations.rs b/src/api/core/organizations.rs index b5d71652..2460ae93 100644 --- a/src/api/core/organizations.rs +++ b/src/api/core/organizations.rs @@ -879,10 +879,6 @@ async fn get_org_details_impl( // cipher, like a Custom member with Delete any collection only. As in Bitwarden, any confirmed member may list them. #[get("/ciphers/organization-details/assigned?")] async fn get_assigned_org_details(data: OrgIdData, headers: Headers, conn: DbConn) -> JsonResult { - // Only the Custom role needs this, every other role that opens the Admin Console may edit every cipher - if !custom_roles_enabled() { - err_code!("Resource not found.", "Custom roles are disabled", Status::NotFound.code); - } let Some(member) = Membership::find_confirmed_by_user_and_org(&headers.user.uuid, &data.organization_id, &conn).await else {