mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-30 09:38:33 +08:00
feat(roles): Change list roles, get role and authorization info api to respond with groups (#3837)
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
@ -1,3 +1,4 @@
|
||||
use common_enums::PermissionGroup;
|
||||
use common_utils::pii;
|
||||
|
||||
use crate::user::DashboardEntryResponse;
|
||||
@ -51,7 +52,14 @@ pub enum PermissionModule {
|
||||
}
|
||||
|
||||
#[derive(Debug, serde::Serialize)]
|
||||
pub struct AuthorizationInfoResponse(pub Vec<ModuleInfo>);
|
||||
pub struct AuthorizationInfoResponse(pub Vec<AuthorizationInfo>);
|
||||
|
||||
#[derive(Debug, serde::Serialize)]
|
||||
#[serde(untagged)]
|
||||
pub enum AuthorizationInfo {
|
||||
Module(ModuleInfo),
|
||||
Group(GroupInfo),
|
||||
}
|
||||
|
||||
#[derive(Debug, serde::Serialize)]
|
||||
pub struct ModuleInfo {
|
||||
@ -60,6 +68,13 @@ pub struct ModuleInfo {
|
||||
pub permissions: Vec<PermissionInfo>,
|
||||
}
|
||||
|
||||
#[derive(Debug, serde::Serialize)]
|
||||
pub struct GroupInfo {
|
||||
pub group: PermissionGroup,
|
||||
pub description: &'static str,
|
||||
pub permissions: Vec<PermissionInfo>,
|
||||
}
|
||||
|
||||
#[derive(Debug, serde::Serialize)]
|
||||
pub struct PermissionInfo {
|
||||
pub enum_name: Permission,
|
||||
|
||||
Reference in New Issue
Block a user