mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-29 17:19:15 +08:00
feat(users): Role info api with parent tags (#5536)
This commit is contained in:
@ -38,6 +38,19 @@ pub enum Permission {
|
||||
GenerateReport,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, serde::Serialize, PartialEq, Eq, Hash)]
|
||||
pub enum ParentGroup {
|
||||
Operations,
|
||||
Connectors,
|
||||
Workflows,
|
||||
Analytics,
|
||||
Users,
|
||||
#[serde(rename = "MerchantAccess")]
|
||||
Merchant,
|
||||
#[serde(rename = "OrganizationAccess")]
|
||||
Organization,
|
||||
}
|
||||
|
||||
#[derive(Debug, serde::Serialize)]
|
||||
pub enum PermissionModule {
|
||||
Payments,
|
||||
@ -63,6 +76,7 @@ pub struct AuthorizationInfoResponse(pub Vec<AuthorizationInfo>);
|
||||
pub enum AuthorizationInfo {
|
||||
Module(ModuleInfo),
|
||||
Group(GroupInfo),
|
||||
GroupWithTag(ParentInfo),
|
||||
}
|
||||
|
||||
#[derive(Debug, serde::Serialize)]
|
||||
@ -79,6 +93,13 @@ pub struct GroupInfo {
|
||||
pub permissions: Vec<PermissionInfo>,
|
||||
}
|
||||
|
||||
#[derive(Debug, serde::Serialize, Clone)]
|
||||
pub struct ParentInfo {
|
||||
pub name: ParentGroup,
|
||||
pub description: &'static str,
|
||||
pub groups: Vec<PermissionGroup>,
|
||||
}
|
||||
|
||||
#[derive(Debug, serde::Serialize)]
|
||||
pub struct PermissionInfo {
|
||||
pub enum_name: Permission,
|
||||
|
||||
Reference in New Issue
Block a user