Browse Source
Merge pull request #365 from CoreFiling/master
Fix the list of users with access to a collection to display correctly.
pull/370/head
Daniel García
6 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
3 additions and
15 deletions
-
src/api/core/organizations.rs
-
src/db/models/organization.rs
|
@ -375,11 +375,7 @@ fn get_collection_users(org_id: String, coll_id: String, _headers: AdminHeaders, |
|
|
}) |
|
|
}) |
|
|
.collect(); |
|
|
.collect(); |
|
|
|
|
|
|
|
|
Ok(Json(json!({ |
|
|
Ok(Json(json!(user_list))) |
|
|
"Data": user_list, |
|
|
|
|
|
"Object": "list", |
|
|
|
|
|
"ContinuationToken": null, |
|
|
|
|
|
}))) |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
#[derive(FromForm)] |
|
|
#[derive(FromForm)] |
|
|
|
@ -293,17 +293,9 @@ impl UserOrganization { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
pub fn to_json_collection_user_details(&self, read_only: bool, conn: &DbConn) -> Value { |
|
|
pub fn to_json_collection_user_details(&self, read_only: bool, conn: &DbConn) -> Value { |
|
|
let user = User::find_by_uuid(&self.user_uuid, conn).unwrap(); |
|
|
|
|
|
|
|
|
|
|
|
json!({ |
|
|
json!({ |
|
|
"OrganizationUserId": self.uuid, |
|
|
"Id": self.uuid, |
|
|
"AccessAll": self.access_all, |
|
|
"ReadOnly": read_only |
|
|
"Name": user.name, |
|
|
|
|
|
"Email": user.email, |
|
|
|
|
|
"Type": self.type_, |
|
|
|
|
|
"Status": self.status, |
|
|
|
|
|
"ReadOnly": read_only, |
|
|
|
|
|
"Object": "collectionUser", |
|
|
|
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|