Added file factory for controlling permissions.