mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-11-01 02:57:02 +08:00
refactor(user_role): Change update user role request to take email instead of user_id (#3530)
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
@ -2,11 +2,7 @@ use api_models::user_role as user_role_api;
|
||||
|
||||
use crate::{
|
||||
consts,
|
||||
core::errors::{UserErrors, UserResult},
|
||||
services::authorization::{
|
||||
permissions::Permission,
|
||||
predefined_permissions::{self, RoleInfo},
|
||||
},
|
||||
services::authorization::{permissions::Permission, predefined_permissions::RoleInfo},
|
||||
};
|
||||
|
||||
pub fn is_internal_role(role_id: &str) -> bool {
|
||||
@ -14,13 +10,6 @@ pub fn is_internal_role(role_id: &str) -> bool {
|
||||
|| role_id == consts::user_role::ROLE_ID_INTERNAL_VIEW_ONLY_USER
|
||||
}
|
||||
|
||||
pub fn validate_role_id(role_id: &str) -> UserResult<()> {
|
||||
if predefined_permissions::is_role_invitable(role_id) {
|
||||
return Ok(());
|
||||
}
|
||||
Err(UserErrors::InvalidRoleId.into())
|
||||
}
|
||||
|
||||
pub fn get_role_name_and_permission_response(
|
||||
role_info: &RoleInfo,
|
||||
) -> Option<(Vec<user_role_api::Permission>, &'static str)> {
|
||||
|
||||
Reference in New Issue
Block a user