Getting privilege to write a file to \Library\ColorSync\Profiles\ in a mac application

Another solution I am posting here. I went through the app distribution guide. It is mentioned that the Authorization APIS are not recommended for an app that is distributed out side of app store. Any way this solution is working for me, it is a little hack, I don't know. I try to run the apple script form the application, which gives full privilege to the folder (chmod 777 path) and after finishing my task set back to previous privilege set.

- (void)runapplescript{
NSDictionary* errorDict;
NSAppleEventDescriptor* returnDescriptor = NULL;
NSAppleScript* scriptObject = [[NSAppleScript alloc] initWithSource:
                               @"do shell script \"chmod 777 /Library/ColorSync/Profiles\" with administrator privileges"];
returnDescriptor = [scriptObject executeAndReturnError: &errorDict];

}