feat(user_roles): add parent group info based API to fetch permissions for user role (#9487)

This commit is contained in:
Kanika Bansal
2025-10-07 19:25:31 +05:30
committed by GitHub
parent 916444b018
commit c44c3ed27d
10 changed files with 207 additions and 93 deletions

View File

@ -36,13 +36,13 @@ pub struct RoleInfoWithGroupsResponse {
#[derive(Debug, serde::Serialize)]
pub struct RoleInfoWithParents {
pub role_id: String,
pub parent_groups: Vec<ParentGroupInfo>,
pub parent_groups: Vec<ParentGroupDescription>,
pub role_name: String,
pub role_scope: RoleScope,
}
#[derive(Debug, serde::Serialize)]
pub struct ParentGroupInfo {
pub struct ParentGroupDescription {
pub name: ParentGroup,
pub description: String,
pub scopes: Vec<PermissionScope>,
@ -74,7 +74,7 @@ pub struct RoleInfoResponseWithParentsGroup {
pub role_id: String,
pub role_name: String,
pub entity_type: EntityType,
pub parent_groups: Vec<ParentGroupInfo>,
pub parent_groups: Vec<ParentGroupDescription>,
pub role_scope: RoleScope,
}
@ -117,3 +117,10 @@ pub enum ListRolesResponse {
WithGroups(Vec<RoleInfoResponseNew>),
WithParentGroups(Vec<RoleInfoResponseWithParentsGroup>),
}
#[derive(Debug, serde::Serialize)]
pub struct ParentGroupInfo {
pub name: ParentGroup,
pub resources: Vec<Resource>,
pub scopes: Vec<PermissionScope>,
}