#![allow(dead_code)]
use serde::{Deserialize, Serialize};
pub use crate::types::permissions::{
PermissionBehavior, PermissionRule, PermissionRuleSource, PermissionRuleValue,
};
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
#[serde(rename_all = "lowercase")]
pub enum PermissionBehaviorSchema {
Allow,
Deny,
Ask,
}
impl From<PermissionBehavior> for PermissionBehaviorSchema {
fn from(behavior: PermissionBehavior) -> Self {
match behavior {
PermissionBehavior::Allow => PermissionBehaviorSchema::Allow,
PermissionBehavior::Deny => PermissionBehaviorSchema::Deny,
PermissionBehavior::Ask => PermissionBehaviorSchema::Ask,
}
}
}
impl From<PermissionBehaviorSchema> for PermissionBehavior {
fn from(schema: PermissionBehaviorSchema) -> Self {
match schema {
PermissionBehaviorSchema::Allow => PermissionBehavior::Allow,
PermissionBehaviorSchema::Deny => PermissionBehavior::Deny,
PermissionBehaviorSchema::Ask => PermissionBehavior::Ask,
}
}
}