Browse Source
Fix issue with 'Apply organization data ownership'
Signed-off-by: BlackDex <black.dex@gmail.com>
pull/6867/head
BlackDex
3 months ago
No known key found for this signature in database
GPG Key ID: 58C80A2AA6C765E1
1 changed files with
23 additions and
0 deletions
-
src/api/core/organizations.rs
|
|
|
@ -67,6 +67,7 @@ pub fn routes() -> Vec<Route> { |
|
|
|
get_master_password_policy, |
|
|
|
get_policy, |
|
|
|
put_policy, |
|
|
|
put_policy_vnext, |
|
|
|
get_plans, |
|
|
|
post_org_keys, |
|
|
|
get_organization_keys, |
|
|
|
@ -2092,6 +2093,28 @@ async fn put_policy( |
|
|
|
Ok(Json(policy.to_json())) |
|
|
|
} |
|
|
|
|
|
|
|
#[derive(Deserialize)] |
|
|
|
struct PolicyDataVnext { |
|
|
|
policy: PolicyData, |
|
|
|
// Ignore metadata for now as we do not yet support this
|
|
|
|
// "metadata": {
|
|
|
|
// "defaultUserCollectionName": "2.xx|xx==|xx="
|
|
|
|
// }
|
|
|
|
} |
|
|
|
|
|
|
|
#[put("/organizations/<org_id>/policies/<pol_type>/vnext", data = "<data>")] |
|
|
|
async fn put_policy_vnext( |
|
|
|
org_id: OrganizationId, |
|
|
|
pol_type: i32, |
|
|
|
data: Json<PolicyDataVnext>, |
|
|
|
headers: AdminHeaders, |
|
|
|
conn: DbConn, |
|
|
|
) -> JsonResult { |
|
|
|
let data: PolicyDataVnext = data.into_inner(); |
|
|
|
let policy: PolicyData = data.policy; |
|
|
|
put_policy(org_id, pol_type, Json(policy), headers, conn).await |
|
|
|
} |
|
|
|
|
|
|
|
#[get("/plans")] |
|
|
|
fn get_plans() -> Json<Value> { |
|
|
|
// Respond with a minimal json just enough to allow the creation of an new organization.
|
|
|
|
|