mirror of
http://192.168.0.88:13333/lywsvip/openclaw-zero-token.git
synced 2026-07-05 18:05:33 +08:00
35 lines
979 B
Swift
35 lines
979 B
Swift
import EventKit
|
||
|
||
enum EventKitAuthorization {
|
||
static func allowsRead(status: EKAuthorizationStatus) -> Bool {
|
||
switch status {
|
||
case .authorized, .fullAccess:
|
||
return true
|
||
case .writeOnly:
|
||
return false
|
||
case .notDetermined:
|
||
// Don’t prompt during node.invoke; prompts block the invoke and lead to timeouts.
|
||
return false
|
||
case .restricted, .denied:
|
||
return false
|
||
@unknown default:
|
||
return false
|
||
}
|
||
}
|
||
|
||
static func allowsWrite(status: EKAuthorizationStatus) -> Bool {
|
||
switch status {
|
||
case .authorized, .fullAccess, .writeOnly:
|
||
return true
|
||
case .notDetermined:
|
||
// Don’t prompt during node.invoke; prompts block the invoke and lead to timeouts.
|
||
return false
|
||
case .restricted, .denied:
|
||
return false
|
||
@unknown default:
|
||
return false
|
||
}
|
||
}
|
||
}
|
||
|