mirror of
				https://github.com/juspay/hyperswitch.git
				synced 2025-10-31 10:06:32 +08:00 
			
		
		
		
	feat: add profile_id authentication for business profile update and list (#5673)
This commit is contained in:
		| @ -1334,7 +1334,7 @@ pub fn get_incremental_authorization_allowed_value( | ||||
|     } | ||||
| } | ||||
|  | ||||
| pub(super) trait GetProfileId { | ||||
| pub(crate) trait GetProfileId { | ||||
|     fn get_profile_id(&self) -> Option<&common_utils::id_type::ProfileId>; | ||||
| } | ||||
|  | ||||
| @ -1381,6 +1381,12 @@ impl<T, F> GetProfileId for (storage::Payouts, T, F) { | ||||
|     } | ||||
| } | ||||
|  | ||||
| impl GetProfileId for domain::BusinessProfile { | ||||
|     fn get_profile_id(&self) -> Option<&common_utils::id_type::ProfileId> { | ||||
|         Some(self.get_id()) | ||||
|     } | ||||
| } | ||||
|  | ||||
| /// Filter Objects based on profile ids | ||||
| pub(super) fn filter_objects_based_on_profile_id_list<T: GetProfileId>( | ||||
|     profile_id_list_auth_layer: Option<Vec<common_utils::id_type::ProfileId>>, | ||||
| @ -1406,7 +1412,7 @@ pub(super) fn filter_objects_based_on_profile_id_list<T: GetProfileId>( | ||||
|     } | ||||
| } | ||||
|  | ||||
| pub(super) fn validate_profile_id_from_auth_layer<T: GetProfileId + std::fmt::Debug>( | ||||
| pub(crate) fn validate_profile_id_from_auth_layer<T: GetProfileId + std::fmt::Debug>( | ||||
|     profile_id_auth_layer: Option<common_utils::id_type::ProfileId>, | ||||
|     object: &T, | ||||
| ) -> RouterResult<()> { | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 Hrithikesh
					Hrithikesh