Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Locking Your Own NSPreferencePane?

Is it possible to implement a locking effect in a NSPreferencePane that we create? Similar to the lock found in other system preferences panes (such as Energy Saver, etc)

I know that I could create a keychain item and then just have the enabled boolean of the controls bound to something that depends on the user authenticating successfully, but is there a better way? Something that presents the same keychain authentication dialog, with the same message, etc?

like image 287
Ryan Avatar asked Dec 10 '25 12:12

Ryan


1 Answers

You should first read the Authorization Services Programming Guide. Once you have understood the concepts, have a look at the SFAuthorizationView class for the lock icon. Note that although they are similar, a keychain dialog is not related to an authentication dialog.

like image 125
0xced Avatar answered Dec 13 '25 01:12

0xced



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!