Fixes potential security issue with processing of smarty templates
Added a few missing permission checks to core modules