Apple - How Should I Correct the Owners and Permissions in an OS X User Folder?

The first step I would recommend is to try resetting your home folder permissions with the Reset Password utility in Lion Recovery. (Despite the name of the utility, you won't actually be resetting any passwords.)

Resetting the home folder permissions with the Reset Password utility will reset both the owner and the permissions.

  1. Restart your Mac holding +R to boot into Lion Recovery, which will bring you to the Repair Utilities screen.

  2. Open Terminal from the Utilities menu.

  3. In Terminal, enter resetpassword to open the Reset Password utility.

  4. Choose your hard drive icon at the top, then choose your user from the drop-down menu below. Do not reset the password here.

  5. At the bottom of the window, under "Reset Home Directory Permissions and ACLs", click the "Reset" button. This may take awhile if you have a lot of files in your home folder.

This should solve your permissions problems for most apps. However, it's possible you may have a few apps which had saved files with special permissions that are different from the user's default permissions (like preferences or application support files). For those apps, you may need to delete their preferences or reinstall the app.

If resetting your home folder permissions doesn't work, then you may need to try restoring from a backup or transferring your data to an external drive.

Run this

cd $HOME
{ sudo chflags -R nouchg,nouappnd ~ $TMPDIR.. ; \
sudo chown -R $UID:staff ~ $_ ; \
sudo chmod -R -N ~ $_ ; \
sudo chmod -R 755 ~ $_ ; \
sudo chmod 700 Desktop Documents Downloads Dropbox Library Movies Music Pictures Sites $_ ; \
sudo chmod 777 Public ; \
sudo chmod 733 Public/Drop\ Box ; \
} 2> /dev/null

Your issues are basically the same. There is no standard for permissions for files in your home directory they all depend on their use.

Fixing permissions apps and scripts and OS installs should not affect the user area at all except maybe changing the permissions on the home directory. OS installs and most fix permissions scripts compare the permissions and owners to what is required for a clean install and this has no normal users. If they did I would consider this as a major bug.

The fix is to change the owner of the files ie use of chown on your home directory. The owner should be the new owner name.

There is no general way of getting permissions back as individual files depend on there application and all apps can be different.

Thus the only way is to restore from a backup before the change - do the change as per Apples notes and then chown all the files. Or look at each individual file and work out what permissions it should have - for most files your home directory this should be read/write for the owner and nothing (or read only ) for others. Directories will also need execute permission so that they can be listed. Applications will need other permissions.