Skip to content

Commit

Permalink
checks: Check for permissions not granted on macOS
Browse files Browse the repository at this point in the history
Check for any permissions that are not granted on macOS and list them
with a warning flag.
  • Loading branch information
prgmitchell committed Nov 28, 2023
1 parent 8891aba commit 5b7a26d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
17 changes: 17 additions & 0 deletions checks/macos.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,20 @@ 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 = "<br><ul><li>" + "</li><li>".join(deniedPermissions) + "</li></ul>"
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 " + '<a href="https://obsproject.com/kb/macos-permissions-guide">macOS Permissions Guide</a>.']
3 changes: 2 additions & 1 deletion loganalyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 5b7a26d

Please sign in to comment.