Hee’s a basic script I created recently to set permissions on a file/folder. This can be integrated with other scripts quite nicely.

Enjoy!