From f89b7a193e96a913b16cc1f7654d0bfb8593e95b Mon Sep 17 00:00:00 2001
From: prgmitchell <86465454+prgmitchell@users.noreply.github.com>
Date: Tue, 28 Nov 2023 14:37:02 -0500
Subject: [PATCH] checks: Check for permissions not granted on macOS
Check for any permissions that are not granted on macOS and list them
with a warning flag.
---
checks/macos.py | 19 +++++++++++++++++++
loganalyzer.py | 3 ++-
2 files changed, 21 insertions(+), 1 deletion(-)
diff --git a/checks/macos.py b/checks/macos.py
index 6b7da81..eeabe59 100644
--- a/checks/macos.py
+++ b/checks/macos.py
@@ -66,3 +66,22 @@ def checkRosettaTranslationStatus(lines):
if (len(search('Rosetta translation used: true', lines)) > 0):
return [LEVEL_WARNING, "Intel OBS on Apple Silicon Mac",
"You are running the Intel version of OBS on an Apple Silicon Mac. You may get improved performance using the Apple Silicon version of OBS."]
+
+
+def checkMacPermissions(lines):
+ macPerms = search('[macOS] Permission for', lines)
+ deniedPermissions = []
+
+ for line in macPerms:
+ if 'denied' in line:
+ found = re.search(r'Permission for (.+) denied', line)
+ if found:
+ permissionName = found.group(1).title()
+ deniedPermissions.append(permissionName)
+
+ if deniedPermissions:
+ deniedPermissionsString = "