2023-08-28 09:24:27 +03:00
|
|
|
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
|
|
|
|
#[repr(i32)]
|
|
|
|
pub enum PermissionType {
|
|
|
|
ReadApplicationState = 0,
|
|
|
|
ChangeApplicationState = 1,
|
|
|
|
OpenFiles = 2,
|
|
|
|
RunCommands = 3,
|
|
|
|
OpenTerminalsOrPlugins = 4,
|
|
|
|
WriteToStdin = 5,
|
2023-10-20 15:20:00 +03:00
|
|
|
WebAccess = 6,
|
2024-01-17 14:10:49 +03:00
|
|
|
ReadCliPipes = 7,
|
|
|
|
MessageAndLaunchOtherPlugins = 8,
|
2024-07-17 17:08:31 +03:00
|
|
|
Reconfigure = 9,
|
2023-08-28 09:24:27 +03:00
|
|
|
}
|
|
|
|
impl PermissionType {
|
|
|
|
/// String value of the enum field names used in the ProtoBuf definition.
|
|
|
|
///
|
|
|
|
/// The values are not transformed in any way and thus are considered stable
|
|
|
|
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
|
|
|
|
pub fn as_str_name(&self) -> &'static str {
|
|
|
|
match self {
|
|
|
|
PermissionType::ReadApplicationState => "ReadApplicationState",
|
|
|
|
PermissionType::ChangeApplicationState => "ChangeApplicationState",
|
|
|
|
PermissionType::OpenFiles => "OpenFiles",
|
|
|
|
PermissionType::RunCommands => "RunCommands",
|
|
|
|
PermissionType::OpenTerminalsOrPlugins => "OpenTerminalsOrPlugins",
|
|
|
|
PermissionType::WriteToStdin => "WriteToStdin",
|
2023-10-20 15:20:00 +03:00
|
|
|
PermissionType::WebAccess => "WebAccess",
|
2024-01-17 14:10:49 +03:00
|
|
|
PermissionType::ReadCliPipes => "ReadCliPipes",
|
|
|
|
PermissionType::MessageAndLaunchOtherPlugins => {
|
|
|
|
"MessageAndLaunchOtherPlugins"
|
|
|
|
}
|
2024-07-17 17:08:31 +03:00
|
|
|
PermissionType::Reconfigure => "Reconfigure",
|
2023-08-28 09:24:27 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
/// Creates an enum from field names used in the ProtoBuf definition.
|
|
|
|
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
|
|
|
|
match value {
|
|
|
|
"ReadApplicationState" => Some(Self::ReadApplicationState),
|
|
|
|
"ChangeApplicationState" => Some(Self::ChangeApplicationState),
|
|
|
|
"OpenFiles" => Some(Self::OpenFiles),
|
|
|
|
"RunCommands" => Some(Self::RunCommands),
|
|
|
|
"OpenTerminalsOrPlugins" => Some(Self::OpenTerminalsOrPlugins),
|
|
|
|
"WriteToStdin" => Some(Self::WriteToStdin),
|
2023-10-20 15:20:00 +03:00
|
|
|
"WebAccess" => Some(Self::WebAccess),
|
2024-01-17 14:10:49 +03:00
|
|
|
"ReadCliPipes" => Some(Self::ReadCliPipes),
|
|
|
|
"MessageAndLaunchOtherPlugins" => Some(Self::MessageAndLaunchOtherPlugins),
|
2024-07-17 17:08:31 +03:00
|
|
|
"Reconfigure" => Some(Self::Reconfigure),
|
2023-08-28 09:24:27 +03:00
|
|
|
_ => None,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|