def METHOD_NAME(self, path):
    """Check that the given path isn't a symlink or outside the doc root."""
    path = Path(path)
    resolved_path = path.resolve()
    if path.is_symlink():
        msg = "Suspicious operation over a symbolic link."
        log.error(msg, path=str(path), resolved_path=str(resolved_path))
        raise SuspiciousFileOperation(msg)
    docroot = Path(settings.DOCROOT).absolute()
    if not path.is_relative_to(docroot):
        msg = "Suspicious operation outside the docroot directory."
        log.error(msg, path=str(path), resolved_path=str(resolved_path))
        raise SuspiciousFileOperation(msg)