Skip to main content

euv_core/system/permissions/
enum.rs

1/// Unified cross-platform operating system privacy and capability permission categories.
2#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
3pub enum SystemPermission {
4    /// Camera / video capture access.
5    Camera,
6    /// Microphone / audio recording access.
7    Microphone,
8    /// Foreground precise or approximate location.
9    LocationWhenInUse,
10    /// Background continuous location access.
11    LocationAlways,
12    /// Local and push user notifications.
13    Notifications,
14    /// Photo library and media gallery access.
15    Photos,
16    /// Address book / contacts read-write access.
17    Contacts,
18    /// System calendar read-write access.
19    Calendar,
20    /// Bluetooth Low Energy / peripheral scanning and connection.
21    Bluetooth,
22    /// Face ID, Touch ID, Android BiometricPrompt, Windows Hello, or WebAuthn passkeys.
23    Biometrics,
24    /// User-selected or scoped local file system storage.
25    FileStorage,
26    /// System clipboard read access.
27    ClipboardRead,
28    /// Accelerometer, gyroscope, and motion/fitness sensors.
29    MotionSensors,
30    /// Local LAN / Bonjour / mDNS peer discovery.
31    LocalNetwork,
32}
33
34/// Normalized authorization state returned across iOS, iPadOS, macOS, Android, Windows, Linux, and Web.
35#[derive(Clone, Copy, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
36pub enum PermissionStatus {
37    /// User has not yet been prompted for this permission.
38    #[default]
39    NotDetermined,
40    /// Full authorization granted by the user or OS policy.
41    Granted,
42    /// Explicitly denied by the user.
43    Denied,
44    /// Blocked by parental controls, MDM, or OS sandbox policy.
45    Restricted,
46    /// Partial access granted (e.g. iOS Selected Photos or approximate location).
47    Limited,
48    /// Hardware or permission API does not exist on the active platform.
49    Unsupported,
50}