|
|
@ -506,10 +506,6 @@ async fn post_organization_collections( |
|
|
let data: FullCollectionData = data.into_inner(); |
|
|
let data: FullCollectionData = data.into_inner(); |
|
|
data.validate(&org_id, &conn).await?; |
|
|
data.validate(&org_id, &conn).await?; |
|
|
|
|
|
|
|
|
if headers.membership.atype == MembershipType::Manager && !headers.membership.access_all { |
|
|
|
|
|
err!("You don't have permission to create collections") |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
let collection = Collection::new(org_id.clone(), data.name, data.external_id); |
|
|
let collection = Collection::new(org_id.clone(), data.name, data.external_id); |
|
|
collection.save(&conn).await?; |
|
|
collection.save(&conn).await?; |
|
|
|
|
|
|
|
|
@ -550,6 +546,10 @@ async fn post_organization_collections( |
|
|
.await?; |
|
|
.await?; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if headers.membership.atype == MembershipType::Manager && !headers.membership.access_all { |
|
|
|
|
|
CollectionUser::save(&headers.membership.user_uuid, &collection.uuid, false, false, true, &conn).await?; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
Ok(Json(collection.to_json_details(&headers.membership.user_uuid, None, &conn).await)) |
|
|
Ok(Json(collection.to_json_details(&headers.membership.user_uuid, None, &conn).await)) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -2473,6 +2473,7 @@ async fn get_groups_data( |
|
|
has_full_access |
|
|
has_full_access |
|
|
} else { |
|
|
} else { |
|
|
has_full_access |
|
|
has_full_access |
|
|
|
|
|
|| headers.membership.atype == MembershipType::Manager |
|
|
|| Collection::has_manageable_collection_by_user(&org_id, &headers.membership.user_uuid, &conn).await |
|
|
|| Collection::has_manageable_collection_by_user(&org_id, &headers.membership.user_uuid, &conn).await |
|
|
}; |
|
|
}; |
|
|
if !allowed { |
|
|
if !allowed { |
|
|
|