Merging file canedit check from 31

Merging 1bc1094303c0a0b7cb5d5721724e2aaece1fbc35 from 3.1 to fix File permission issues in the CMS.

This will eventually be resolved by upgrading to 3.1, but for the meantime this works.