zut.context.assert_root
- zut.context.assert_root(*, logger: Logger | None = None) None
Raise an exception if the current user is not root (Linux/macOS) or does not have admin privileges (Windows).
- Parameters:
logger – If provided, exit with an error message instead of raising an exception.