According to the Apple’s document, it is possible to use the CFPreferences and SFAuthorizationView to authenticate and authorize as an admin or the root. However, I found something strange. Although it was successful to be authorized as an admin using the SFAuthorizationView and CFPreferences functions, it didn’t create preference files in /Library/Preferences. What I mean is.. even though CFPreferencesCopyValue() and CFPreferencesSetValue() are called successfully, it doesn’t create a preference file in the /Library/Preferences.
Why? I don’t know. Actually I didn’t have enough time to fix it.
But, anyway, for being able to retrieve system-wide setting when you open your preference pane, accessing by requesting admin ID and password is not good. Only when you want to set value, it should ask such information.
Apple provides a good sample code for such cases. You can just grab the CFPreferences_SharedAppValue.c and h and use them.