Linux permission denied issue with folder other than ~/Sync

If you get “permission denied” error on one of your files, in a custom folder, make sure to do the following:

chgrp -R youruser customfolder/
chown -R youruser customfolder/

youruser means your username other than root

then you are free from these kinda errors.

In details: I made the mistake of creating a folder with root user, than synced it.

I tried to resolve this issue for 2 or more hours, had to learn about permissions in linux a lot, and thats good, but i hate the fact that i didn’t solve it from google.