From 84e901b7d267591aca660e0bca7f0d0f620534d3 Mon Sep 17 00:00:00 2001 From: Jan Jansen Date: Fri, 23 Jun 2023 08:26:45 +0200 Subject: [PATCH] add user to collection during creation Signed-off-by: Jan Jansen --- src/api/core/organizations.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/api/core/organizations.rs b/src/api/core/organizations.rs index 6eaeeb63..40901d31 100644 --- a/src/api/core/organizations.rs +++ b/src/api/core/organizations.rs @@ -424,6 +424,10 @@ async fn post_organization_collections( .await?; } + if headers.org_user.atype == UserOrgType::Manager && !headers.org_user.access_all { + CollectionUser::save(&headers.org_user.user_uuid, &collection.uuid, false, false, &mut conn).await?; + } + Ok(Json(collection.to_json())) }