umask can be used to restrict file permissions within a script. i often find umask useful when creating temp files inside a script running in setuid mode as root.
it won't allow full control of file permissions, but i think it's a good solution to the situation i've mentioned above.