From 1a95f46ba1972f3c7814af36a68957a5af814448 Mon Sep 17 00:00:00 2001 From: Sebastian Pravda Date: Sun, 15 Jan 2023 16:06:18 +0100 Subject: [PATCH] refactor: no restrict access arg --- api/src/routes/admin.rs | 3 +-- api/src/routes/candidate.rs | 3 +-- core/src/services/application_service.rs | 5 ----- 3 files changed, 2 insertions(+), 9 deletions(-) diff --git a/api/src/routes/admin.rs b/api/src/routes/admin.rs index 4ffc1d1..bd4298c 100644 --- a/api/src/routes/admin.rs +++ b/api/src/routes/admin.rs @@ -167,8 +167,7 @@ pub async fn get_candidate( let details = ApplicationService::decrypt_all_details( private_key, db, - &application, - false, + &application ) .await .map_err(to_custom_error)?; diff --git a/api/src/routes/candidate.rs b/api/src/routes/candidate.rs index 35f7429..b8a3550 100644 --- a/api/src/routes/candidate.rs +++ b/api/src/routes/candidate.rs @@ -124,8 +124,7 @@ pub async fn get_details( let details = ApplicationService::decrypt_all_details( private_key, db, - &application, - true + &application ) .await .map(|x| Json(x)) diff --git a/core/src/services/application_service.rs b/core/src/services/application_service.rs index 236111e..503354c 100644 --- a/core/src/services/application_service.rs +++ b/core/src/services/application_service.rs @@ -215,14 +215,9 @@ impl ApplicationService { private_key: String, db: &DbConn, application: &application::Model, - restrict_access: bool, ) -> Result { let candidate = ApplicationService::find_related_candidate(db, application).await?; - /* if restrict_access && candidate.encrypted_by_id.is_some() && candidate.encrypted_by_id != Some(application.id) { - return Err(ServiceError::Locked) - } */ - let parents = Query::find_candidate_parents(db, &candidate).await?; let enc_details = EncryptedApplicationDetails::from((&candidate, parents));