node-mac-permissions
Advanced tools
Comparing version 2.0.0 to 2.1.0
10
index.js
@@ -1,2 +0,2 @@ | ||
const permissions = require('bindings')('permissions.node'); | ||
const permissions = require('bindings')('permissions.node') | ||
@@ -14,9 +14,9 @@ function getAuthStatus(type) { | ||
'screen', | ||
]; | ||
] | ||
if (!validTypes.includes(type)) { | ||
throw new TypeError(`${type} is not a valid type`); | ||
throw new TypeError(`${type} is not a valid type`) | ||
} | ||
return permissions.getAuthStatus.call(this, type); | ||
return permissions.getAuthStatus.call(this, type) | ||
} | ||
@@ -34,2 +34,2 @@ | ||
getAuthStatus, | ||
}; | ||
} |
{ | ||
"name": "node-mac-permissions", | ||
"version": "2.0.0", | ||
"version": "2.1.0", | ||
"description": "A native node module to manage system permissions on macOS", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -117,2 +117,3 @@ [![MIT license](https://img.shields.io/badge/License-MIT-blue.svg)](https://lbesson.mit-license.org/) | ||
Example: | ||
```js | ||
@@ -130,5 +131,5 @@ const { askForFullDiskAccess } = require('node-mac-permissions') | ||
- `not determined`, the camera access authorization will prompt the user to authorize or deny. The Promise is resolved after the user selection with either `authorized` or `denied`. | ||
- `denied`, the `Security & Privacy` System Preferences window is opened with the Camera privacy key highlighted. On open of the `Security & Privacy` window, the Promise is resolved as `denied`. | ||
- `restricted`, the Promise is resolved as `restricted`. | ||
* `not determined` - The camera access authorization will prompt the user to authorize or deny. The Promise is resolved after the user selection with either `authorized` or `denied`. | ||
* `denied` - The `Security & Privacy` System Preferences window is opened with the Camera privacy key highlighted. On open of the `Security & Privacy` window, the Promise is resolved as `denied`. | ||
* `restricted` - The Promise is resolved as `restricted`. | ||
@@ -160,5 +161,5 @@ Your app must provide an explanation for its use of capture devices using the `NSCameraUsageDescription` `Info.plist` key; Calling this method or attempting to start a capture session without a usage description raises an exception. | ||
- `not determined`, the microphone access authorization will prompt the user to authorize or deny. The Promise is resolved after the user selection with either `authorized` or `denied`. | ||
- `denied`, the `Security & Privacy` System Preferences window is opened with the Microphone privacy key highlighted. On open of the `Security & Privacy` window, the Promise is resolved as `denied`. | ||
- `restricted`, the Promise is resolved as `restricted`. | ||
* `not determined` - The microphone access authorization will prompt the user to authorize or deny. The Promise is resolved after the user selection with either `authorized` or `denied`. | ||
* `denied` -T he `Security & Privacy` System Preferences window is opened with the Microphone privacy key highlighted. On open of the `Security & Privacy` window, the Promise is resolved as `denied`. | ||
* `restricted` - The Promise is resolved as `restricted`. | ||
@@ -189,2 +190,3 @@ Your app must provide an explanation for its use of capture devices using the `NSMicrophoneUsageDescription` `Info.plist` key; Calling this method or attempting to start a capture session without a usage description raises an exception. | ||
Example: | ||
```js | ||
@@ -201,2 +203,3 @@ const { askForScreenCaptureAccess } = require('node-mac-permissions') | ||
Example: | ||
```js | ||
@@ -219,1 +222,34 @@ const { askForAccessibilityAccess } = require('node-mac-permissions') | ||
A. This error means that webpack packed this module, which it should not. To fix this, you should configure webpack to use this module externally, e.g explicitly not pack it. | ||
---------------------- | ||
Q. I've authorized access to a particular system component and want to reset it. How do I do that? | ||
A. You can use `tccutil` to do this! | ||
The `tccutil` command manages the privacy database, which stores decisions the user has made about whether apps may access personal data. | ||
Examples: | ||
```sh | ||
# Reset all app permissions | ||
$ tccutil reset All | ||
# Reset Accessibility access permissions | ||
$ tccutil reset Accessibility | ||
# Reset Reminders access permissions | ||
$ tccutil reset Reminders | ||
# Reset Calendar access permissions | ||
$ tccutil reset Calendar | ||
# Reset Camera access permissions | ||
$ tccutil reset Camera | ||
# Reset Microphone access permissions | ||
$ tccutil reset Microphone | ||
# Reset Photos access permissions | ||
$ tccutil reset Photos | ||
``` |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
30594
250