Refactor the attachment permission code so that new parent resource realms can be more easily added.
Authored by: cboos 2007-06-01
Parent: [r5560]
Child: [r5562]