• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: CFPreferencesSetValue in pref pane not working if logged in as non-admin
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CFPreferencesSetValue in pref pane not working if logged in as non-admin


  • Subject: Re: CFPreferencesSetValue in pref pane not working if logged in as non-admin
  • From: Chris Parker <email@hidden>
  • Date: Tue, 13 Nov 2001 18:39:47 -0800

Hi Kevin,

The rule with CFPreferences and "this host, any user" prefs is that a non-admin user should not be able to set global preferences.

The non-admin user -should- however be able to read them - if that's happening, it's a problem of which I am not aware and would love to see an example.

.chris

On Tuesday, November 13, 2001, at 06:21 AM, Kevin Bohan wrote:

Hi,

I have a pref pane that allows any user to change global (shared) settings. As the pane is manipulating global settings the associated pref file in located in /Library/Preferences, not in ~/Library/Preferences. To store the value in that domain I do the following:

CFPreferencesSetValue(str, tempNum, MY_PREF_FILE_NAME, kCFPreferencesAnyUser, kCFPreferencesCurrentHost);

However I have noticed that if I log in as a non admin user this function appears to fail, as does the get function.

What this means is that I can log in as an admin, use the preference pane and the settings will be saved, and can be viewed by any other admin. If I log in as a non-admin my pref pane resorts to showing default values (same as if there was no preference file) and I cannot change any of the settings.

The easiest way to see this in action is when I log in as a non-admin, open the pref pane, change something and then close System Preferences, open it again and see the the value have not changed.

I presume this has something to do with authorization. However, I can see nothing in the documentation of the CFPreferences... functions that say I need to wrap these calls in some kind of authorization.

Any one see where I'm going wrong?

Kirby

--
Chris Parker <email@hidden>
Cocoa Frameworks Engineer
Catapultum habeo. Nisi pecuniam omnem mihi dabis, ad caput tuum
saxum immane mittam.


References: 
 >CFPreferencesSetValue in pref pane not working if logged in as non-admin (From: "Kevin Bohan" <email@hidden>)

  • Prev by Date: Re: OSALoad/OSACompile block when machine is asleep
  • Next by Date: Re: NSWindowController that closes itself
  • Previous by thread: Re: CFPreferencesSetValue in pref pane not working if logged in as non-admin
  • Next by thread: Outline view questions (hide items & multiple line text)
  • Index(es):
    • Date
    • Thread