mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-30 09:38:33 +08:00
feat(user): create apis for custom role (#3763)
Co-authored-by: Mani Chandra Dulam <mani.dchandra@juspay.in> Co-authored-by: Mani Chandra <84711804+ThisIsMani@users.noreply.github.com>
This commit is contained in:
30
crates/api_models/src/user_role/role.rs
Normal file
30
crates/api_models/src/user_role/role.rs
Normal file
@ -0,0 +1,30 @@
|
||||
use common_enums::{PermissionGroup, RoleScope};
|
||||
|
||||
#[derive(Debug, serde::Deserialize, serde::Serialize)]
|
||||
pub struct CreateRoleRequest {
|
||||
pub role_name: String,
|
||||
pub groups: Vec<PermissionGroup>,
|
||||
pub role_scope: RoleScope,
|
||||
}
|
||||
|
||||
#[derive(Debug, serde::Deserialize, serde::Serialize)]
|
||||
pub struct UpdateRoleRequest {
|
||||
pub groups: Option<Vec<PermissionGroup>>,
|
||||
pub role_name: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, serde::Serialize)]
|
||||
pub struct ListRolesResponse(pub Vec<RoleInfoResponse>);
|
||||
|
||||
#[derive(Debug, serde::Serialize)]
|
||||
pub struct RoleInfoResponse {
|
||||
pub role_id: String,
|
||||
pub permissions: Vec<super::Permission>,
|
||||
pub role_name: String,
|
||||
pub role_scope: RoleScope,
|
||||
}
|
||||
|
||||
#[derive(Debug, serde::Deserialize, serde::Serialize)]
|
||||
pub struct GetRoleRequest {
|
||||
pub role_id: String,
|
||||
}
|
||||
Reference in New Issue
Block a user