Added security checks. If id is zero check user that created the attachment, if it isn't check that they have edit or read access.
Added security checks. If id is zero check user that created the attachment, if it isn't check that they have edit or read access.

ucdavis/Purchasing,ucdavis/Purchasing,ucdavis/Purchasing