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