mirror of
https://github.com/hansjone/oclaw.git
synced 2026-10-10 01:20:46 +08:00
同时收敛启动与运维脚本默认行为(含 wiki worker)、更新 Admin 可观测性与相关测试,降低首轮时延并提高运行稳定性。 Made-with: Cursor
34 lines
979 B
Swift
34 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
|
||
}
|
||
}
|
||
}
|
||
|