On 2009 Feb 13, at 16:54, Nick Zitzmann wrote:


On Feb 13, 2009, at 4:54 PM, Alexander Shmelev wrote:

I have found that I should use Security.framework. Then I wrote code below, it shows authentication dialog for limited user, but settings still not saving for limited user.
What do I do wrong? Could you advise me how to fix code?


You can't elevate an existing task's privileges, so you'll have to do whatever you need to do in a helper app invoked with AuthorizationExecuteWithPrivileges(). See the BetterAuthorizationSample sample code on ADC for details.

Nick is correct about BetterAuthorizationSample.

While scratching my head over BetterAuthorizationSample during a week or so last year, I wrote a wrapper for it which you might find useful or at least enlightening....

http://www.sheepsystems.com/sourceCode/authTasksCocoa.html

Read the readme.rtf in the project. One of the "application cases" included in the demo is writing to kCFPreferencesAnyUser, since I needed to do that too.
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to