fix unauthorized access to margins for external user