refactor: no restrict access arg

This commit is contained in:
Sebastian Pravda 2023-01-15 16:06:18 +01:00
parent 3e2481e336
commit 1a95f46ba1
No known key found for this signature in database
GPG key ID: F3BC84F08EFA3F57
3 changed files with 2 additions and 9 deletions

View file

@ -167,8 +167,7 @@ pub async fn get_candidate(
let details = ApplicationService::decrypt_all_details( let details = ApplicationService::decrypt_all_details(
private_key, private_key,
db, db,
&application, &application
false,
) )
.await .await
.map_err(to_custom_error)?; .map_err(to_custom_error)?;

View file

@ -124,8 +124,7 @@ pub async fn get_details(
let details = ApplicationService::decrypt_all_details( let details = ApplicationService::decrypt_all_details(
private_key, private_key,
db, db,
&application, &application
true
) )
.await .await
.map(|x| Json(x)) .map(|x| Json(x))

View file

@ -215,14 +215,9 @@ impl ApplicationService {
private_key: String, private_key: String,
db: &DbConn, db: &DbConn,
application: &application::Model, application: &application::Model,
restrict_access: bool,
) -> Result<ApplicationDetails, ServiceError> { ) -> Result<ApplicationDetails, ServiceError> {
let candidate = ApplicationService::find_related_candidate(db, application).await?; 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 parents = Query::find_candidate_parents(db, &candidate).await?;
let enc_details = EncryptedApplicationDetails::from((&candidate, parents)); let enc_details = EncryptedApplicationDetails::from((&candidate, parents));