CFPreferencesSetValue in pref pane not working if logged in as non-admin
CFPreferencesSetValue in pref pane not working if logged in as non-admin
- Subject: CFPreferencesSetValue in pref pane not working if logged in as non-admin
- From: "Kevin Bohan" <email@hidden>
- Date: Tue, 13 Nov 2001 14:21:52 +0000
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
_________________________________________________________________
Get your FREE download of MSN Explorer at
http://explorer.msn.com/intl.asp