From 610c1c575253ddf7a1a31ef941efaae2dd676b48 Mon Sep 17 00:00:00 2001 From: Apoorv Dixit <64925866+apoorvdixit88@users.noreply.github.com> Date: Tue, 30 Jan 2024 20:15:47 +0530 Subject: [PATCH] fix(user): change permission for sample data (#3462) --- crates/router/src/routes/lock_utils.rs | 4 ++-- crates/router/src/routes/user.rs | 4 ++-- crates/router/src/routes/user_role.rs | 2 +- crates/router_env/src/logger/types.rs | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/crates/router/src/routes/lock_utils.rs b/crates/router/src/routes/lock_utils.rs index 4cd85efe8d50..2837c1defa4a 100644 --- a/crates/router/src/routes/lock_utils.rs +++ b/crates/router/src/routes/lock_utils.rs @@ -179,7 +179,6 @@ impl From for ApiIdentifier { | Flow::ResetPassword | Flow::InviteUser | Flow::InviteMultipleUser - | Flow::DeleteUser | Flow::UserSignUpWithMerchantId | Flow::VerifyEmailWithoutInviteChecks | Flow::VerifyEmail @@ -191,7 +190,8 @@ impl From for ApiIdentifier { | Flow::GetRoleFromToken | Flow::UpdateUserRole | Flow::GetAuthorizationInfo - | Flow::AcceptInvitation => Self::UserRole, + | Flow::AcceptInvitation + | Flow::DeleteUserRole => Self::UserRole, Flow::GetActionUrl | Flow::SyncOnboardingStatus | Flow::ResetTrackingId => { Self::ConnectorOnboarding diff --git a/crates/router/src/routes/user.rs b/crates/router/src/routes/user.rs index 88e19ddf7550..d4bdcaae87fc 100644 --- a/crates/router/src/routes/user.rs +++ b/crates/router/src/routes/user.rs @@ -257,7 +257,7 @@ pub async fn generate_sample_data( &http_req, payload.into_inner(), sample_data::generate_sample_data_for_user, - &auth::JWTAuth(Permission::MerchantAccountWrite), + &auth::JWTAuth(Permission::PaymentWrite), api_locking::LockAction::NotApplicable, )) .await @@ -277,7 +277,7 @@ pub async fn delete_sample_data( &http_req, payload.into_inner(), sample_data::delete_sample_data_for_user, - &auth::JWTAuth(Permission::MerchantAccountWrite), + &auth::JWTAuth(Permission::PaymentWrite), api_locking::LockAction::NotApplicable, )) .await diff --git a/crates/router/src/routes/user_role.rs b/crates/router/src/routes/user_role.rs index 3f9ccda8651f..ec05db1d6150 100644 --- a/crates/router/src/routes/user_role.rs +++ b/crates/router/src/routes/user_role.rs @@ -121,7 +121,7 @@ pub async fn delete_user_role( req: HttpRequest, payload: web::Json, ) -> HttpResponse { - let flow = Flow::DeleteUser; + let flow = Flow::DeleteUserRole; Box::pin(api::server_wrap( flow, state.clone(), diff --git a/crates/router_env/src/logger/types.rs b/crates/router_env/src/logger/types.rs index ac2dfb47c63d..8e32cb633341 100644 --- a/crates/router_env/src/logger/types.rs +++ b/crates/router_env/src/logger/types.rs @@ -327,8 +327,8 @@ pub enum Flow { InviteUser, /// Invite multiple users InviteMultipleUser, - /// Delete user - DeleteUser, + /// Delete user role + DeleteUserRole, /// Incremental Authorization flow PaymentsIncrementalAuthorization, /// Get action URL for connector onboarding