diff --git a/wfassoc-cdylib/cbinding/wfassoc++.h b/wfassoc-cdylib/cbinding/wfassoc++.h index df91eeb..662c13c 100644 --- a/wfassoc-cdylib/cbinding/wfassoc++.h +++ b/wfassoc-cdylib/cbinding/wfassoc++.h @@ -79,6 +79,18 @@ inline void _Check(wfassoc::WFError result) { } } +/** + * @brief Check if the current process has administrative privileges + * + * @return true if the current process has administrative privileges, false otherwise + * @throws std::runtime_error if the operation fails + */ +inline bool HasPrivilege() { + bool result = false; + _Check(wfassoc::WFHasPrivilege(&result)); + return result; +} + /** * @brief Schema object for defining a program's file association configuration *