mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-29 00:49:42 +08:00
fix(user_role): Filter out internal roles in list roles API (#9402)
Co-authored-by: Mani Chandra <84711804+ThisIsMani@users.noreply.github.com> Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
ba74587e1d
commit
d7e468f9be
@ -1,4 +1,4 @@
|
||||
use std::{cmp, collections::HashSet};
|
||||
use std::{cmp, collections::HashSet, ops::Not};
|
||||
|
||||
use api_models::user_role::role as role_api;
|
||||
use common_enums::{EntityType, ParentGroup, PermissionGroup};
|
||||
@ -450,7 +450,11 @@ pub async fn list_roles_with_info(
|
||||
.into());
|
||||
}
|
||||
|
||||
let mut role_info_vec = PREDEFINED_ROLES.values().cloned().collect::<Vec<_>>();
|
||||
let mut role_info_vec = PREDEFINED_ROLES
|
||||
.values()
|
||||
.filter(|role| role.is_internal().not())
|
||||
.cloned()
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
let user_role_entity = user_role_info.get_entity_type();
|
||||
let is_lineage_data_required = request.entity_type.is_none();
|
||||
|
||||
Reference in New Issue
Block a user