mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-11-01 19:42:27 +08:00
refactor(enums): recon - include ReconOps variant in PermissionsGroup for backwards compatibility with data in DB (#6767)
This commit is contained in:
@ -2828,10 +2828,9 @@ pub enum PermissionGroup {
|
|||||||
ReconReportsView,
|
ReconReportsView,
|
||||||
ReconReportsManage,
|
ReconReportsManage,
|
||||||
ReconOpsView,
|
ReconOpsView,
|
||||||
// Alias is added for backward compatibility with database
|
|
||||||
// TODO: Remove alias post migration
|
|
||||||
#[serde(alias = "recon_ops")]
|
|
||||||
ReconOpsManage,
|
ReconOpsManage,
|
||||||
|
// TODO: To be deprecated, make sure DB is migrated before removing
|
||||||
|
ReconOps,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, serde::Serialize, PartialEq, Eq, Hash, strum::EnumIter)]
|
#[derive(Clone, Debug, serde::Serialize, PartialEq, Eq, Hash, strum::EnumIter)]
|
||||||
|
|||||||
@ -43,7 +43,7 @@ fn get_group_description(group: PermissionGroup) -> &'static str {
|
|||||||
PermissionGroup::ReconReportsView => "View and access reconciliation reports and analytics",
|
PermissionGroup::ReconReportsView => "View and access reconciliation reports and analytics",
|
||||||
PermissionGroup::ReconReportsManage => "Manage reconciliation reports",
|
PermissionGroup::ReconReportsManage => "Manage reconciliation reports",
|
||||||
PermissionGroup::ReconOpsView => "View and access reconciliation operations",
|
PermissionGroup::ReconOpsView => "View and access reconciliation operations",
|
||||||
PermissionGroup::ReconOpsManage => "Manage reconciliation operations",
|
PermissionGroup::ReconOpsManage | PermissionGroup::ReconOps => "Manage reconciliation operations",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -33,6 +33,7 @@ impl PermissionGroupExt for PermissionGroup {
|
|||||||
| Self::OrganizationManage
|
| Self::OrganizationManage
|
||||||
| Self::AccountManage
|
| Self::AccountManage
|
||||||
| Self::ReconOpsManage
|
| Self::ReconOpsManage
|
||||||
|
| Self::ReconOps
|
||||||
| Self::ReconReportsManage => PermissionScope::Write,
|
| Self::ReconReportsManage => PermissionScope::Write,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -49,7 +50,7 @@ impl PermissionGroupExt for PermissionGroup {
|
|||||||
| Self::MerchantDetailsManage
|
| Self::MerchantDetailsManage
|
||||||
| Self::AccountView
|
| Self::AccountView
|
||||||
| Self::AccountManage => ParentGroup::Account,
|
| Self::AccountManage => ParentGroup::Account,
|
||||||
Self::ReconOpsView | Self::ReconOpsManage => ParentGroup::ReconOps,
|
Self::ReconOpsView | Self::ReconOpsManage | Self::ReconOps => ParentGroup::ReconOps,
|
||||||
Self::ReconReportsView | Self::ReconReportsManage => ParentGroup::ReconReports,
|
Self::ReconReportsView | Self::ReconReportsManage => ParentGroup::ReconReports,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -81,7 +82,7 @@ impl PermissionGroupExt for PermissionGroup {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Self::ReconOpsView => vec![Self::ReconOpsView],
|
Self::ReconOpsView => vec![Self::ReconOpsView],
|
||||||
Self::ReconOpsManage => vec![Self::ReconOpsView, Self::ReconOpsManage],
|
Self::ReconOpsManage | Self::ReconOps => vec![Self::ReconOpsView, Self::ReconOpsManage],
|
||||||
|
|
||||||
Self::ReconReportsView => vec![Self::ReconReportsView],
|
Self::ReconReportsView => vec![Self::ReconReportsView],
|
||||||
Self::ReconReportsManage => vec![Self::ReconReportsView, Self::ReconReportsManage],
|
Self::ReconReportsManage => vec![Self::ReconReportsView, Self::ReconReportsManage],
|
||||||
|
|||||||
Reference in New Issue
Block a user