fix(client >> session >> data): made a deserializable enum for permissions instead of using strings
This commit is contained in:
parent
104683381c
commit
1906d66026
|
@ -1,25 +1,30 @@
|
|||
use serde::Deserialize;
|
||||
|
||||
#[derive(Debug, Deserialize)]
|
||||
pub enum Permission {
|
||||
GenerateInviteTokens,
|
||||
PromoteUsers,
|
||||
}
|
||||
|
||||
pub mod api {
|
||||
use super::Deserialize;
|
||||
use super::*;
|
||||
|
||||
pub mod account {
|
||||
use super::Deserialize;
|
||||
use super::*;
|
||||
|
||||
pub mod info {
|
||||
use super::Deserialize;
|
||||
use super::*;
|
||||
|
||||
#[derive(Debug, Deserialize)]
|
||||
pub struct Response {
|
||||
pub userid: String,
|
||||
// TODO: make permissions an enum
|
||||
pub permissions: Vec<String>,
|
||||
pub permissions: Vec<Permission>,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub mod error {
|
||||
use super::Deserialize;
|
||||
use super::*;
|
||||
|
||||
#[derive(Debug, thiserror::Error, Deserialize)]
|
||||
pub enum Error {
|
||||
|
|
Loading…
Reference in New Issue