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 = "
" + return [LEVEL_WARNING, "Permissions Not Granted (" + str(len(deniedPermissions)) + ")", + """Access to the following permissions has not been granted:""" + deniedPermissionsString + + "If you would like to grant permissions for the above, follow the instructions in the " + + 'macOS Permissions Guide.'] diff --git a/loganalyzer.py b/loganalyzer.py index eb5a230..a705414 100755 --- a/loganalyzer.py +++ b/loganalyzer.py @@ -180,7 +180,8 @@ def doAnalysis(url=None, filename=None): checkPluginList(logLines), checkVantage(logLines), checkPortableMode(logLines), - checkSafeMode(logLines) + checkSafeMode(logLines), + checkMacPermissions(logLines) ]) messages.extend(checkVideoSettings(logLines)) m = parseScenes(logLines)