Skip to content

Commit f6c5126

Browse files
committed
docs: explain tccutil reset
1 parent c1e8063 commit f6c5126

File tree

1 file changed

+42
-6
lines changed

1 file changed

+42
-6
lines changed

README.md

Lines changed: 42 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ askForRemindersAccess().then(status => {
114114
There is no API for programmatically requesting Full Disk Access on macOS at this time, and so calling this method will trigger opening of System Preferences at the Full Disk pane of Security and Privacy.
115115

116116
Example:
117+
117118
```js
118119
const { askForFullDiskAccess } = require('node-mac-permissions')
119120

@@ -126,9 +127,9 @@ Returns `Promise<String>` - Current permission status; can be `authorized`, `den
126127

127128
Checks the authorization status for camera access. If the status check returns:
128129

129-
- `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`.
130-
- `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`.
131-
- `restricted`, the Promise is resolved as `restricted`.
130+
* `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`.
131+
* `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`.
132+
* `restricted` - The Promise is resolved as `restricted`.
132133

133134
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.
134135

@@ -155,9 +156,9 @@ Returns `Promise<String>` - Current permission status; can be `authorized`, `den
155156

156157
Checks the authorization status for microphone access. If the status check returns:
157158

158-
- `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`.
159-
- `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`.
160-
- `restricted`, the Promise is resolved as `restricted`.
159+
* `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`.
160+
* `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`.
161+
* `restricted` - The Promise is resolved as `restricted`.
161162

162163
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.
163164

@@ -183,6 +184,7 @@ const status = await askForMicrophoneAccess();
183184
There is no API for programmatically requesting Screen Capture on macOS at this time, and so calling this method will trigger opening of System Preferences at the Screen Capture pane of Security and Privacy.
184185

185186
Example:
187+
186188
```js
187189
const { askForScreenCaptureAccess } = require('node-mac-permissions')
188190

@@ -194,6 +196,7 @@ askForScreenCaptureAccess()
194196
There is no API for programmatically requesting Accessibility access on macOS at this time, and so calling this method will trigger opening of System Preferences at the Accessibility pane of Security and Privacy.
195197

196198
Example:
199+
197200
```js
198201
const { askForAccessibilityAccess } = require('node-mac-permissions')
199202

@@ -211,3 +214,36 @@ TypeError: Cannot read property 'indexOf' of undefined
211214
```
212215

213216
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.
217+
218+
----------------------
219+
220+
Q. I've authorized access to a particular system component and want to reset it. How do I do that?
221+
222+
A. You can use `tccutil` to do this!
223+
224+
The `tccutil` command manages the privacy database, which stores decisions the user has made about whether apps may access personal data.
225+
226+
Examples:
227+
228+
```sh
229+
# Reset all app permissions
230+
$ tccutil reset All
231+
232+
# Reset Accessibility access permissions
233+
$ tccutil reset Accessibility
234+
235+
# Reset Reminders access permissions
236+
$ tccutil reset Reminders
237+
238+
# Reset Calendar access permissions
239+
$ tccutil reset Calendar
240+
241+
# Reset Camera access permissions
242+
$ tccutil reset Camera
243+
244+
# Reset Microphone access permissions
245+
$ tccutil reset Microphone
246+
247+
# Reset Photos access permissions
248+
$ tccutil reset Photos
249+
```

0 commit comments

Comments
 (0)