Jump to content

Switch to Finder when operation requires authentication


vitor

Recommended Posts

I’m on a Mac with a fingerprint sensor (but this might happen with password prompts as well). Here’s what happens when I’m on any app but the Finder and use Alfred to navigate to and delete a path with elevated permissions:

804852327_Screenshot2021-02-27at19_40_00.thumb.png.f010237b8db23499f2410174418bf08e.png

 

And here’s what happens if I do the same thing but the Finder is the active app:

252899838_Screenshot2021-02-27at19_39_56.thumb.png.d35fb2fe6951101c268285b0a323ff73.png

This is a huge difference. On the latter I need only put my finger to the sensor and the operation is complete. On the former, because the Finder isn’t active, neither is the dialog, and putting my finger on the sensor does nothing. I have to go to the trackpad and click the dialog (or ⌘⇥ to the Finder) and only then use the sensor. Same thing happens with a move operation.

 

This is mildly annoying, and I’d argue anyone that does this operation would prefer to be sent to the Finder automatically, because we need to do it manually every time anyway (and there’s no reason you wouldn’t want to; the prompt is floating in your face). Bonus points if Alfred switches back to the original application after the operation is done.

 

I’m guessing Alfred only send the request to the Finder, so it doesn’t know of the permissions in advance. But it probably could (couldn’t it?). It’s an extra internal operation, but I’d say it’s worth it, especially because it’d fix another bug (which I think I have already reported but am not finding):

 

Use Alfred to try to trash or move a file with elevated permissions, and when the authentication prompt appears, cancel. The operation won’t complete, but Alfred shows a notifications saying it did.

Link to comment
Share on other sites

On 2/27/2021 at 7:59 PM, vitor said:

But it probably could (couldn’t it?)

 

I'd be extremely surprised if there were any of knowing that macOS is about to show a permissions dialog, as this thing is usually completely opaque in macOS.

 

The built-in copy/move/delete actions are telling Finder to move these files, so one option could be to make Finder active before doing this, but that is possibly not desired for when the elevations of permissions isn't required as it'll defocus the current app.

 

This is a interesting conundrum to fix robustly, with future proofing, and not fudging. I'll have a think about what can be done.

Link to comment
Share on other sites

36 minutes ago, Andrew said:

any of knowing that macOS is about to show a permissions dialog

 

In this case, I imagine checking the file belongs to the user (and that they have write permission to the destination in the case of Move) would identify the vast majority of situations where Finder is going to ask for authentication.

Link to comment
Share on other sites

56 minutes ago, deanishe said:

In this case, I imagine checking the file belongs to the user (and that they have write permission to the destination in the case of Move) would identify the vast majority of situations where Finder is going to ask for authentication.


That’s what I was thinking; an ownership and/or permissions check.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...