Added document permission checker.