Core: ProcessHasAdminRights() function is added to utility functions. (#242)

* Core: ProcessHasAdminRights() function is added to utility functions.

* reference/DetectPrivegedProcess: Cosmetics.

* Core: ProcessHasAdminRights() renamed as IsAdmin()

* Core: IsAdmin() renamed as IsUserAdmin().
This commit is contained in:
İsmail Yılmaz 2025-04-18 13:46:36 +03:00 committed by GitHub
parent 707f3f7602
commit 1c48bd493c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 54 additions and 0 deletions

View file

@ -0,0 +1,12 @@
#include <CtrlLib/CtrlLib.h>
using namespace Upp;
GUI_APP_MAIN
{
// Run the example as administrator (Windows) or as root (POSIX) to get the warning.
if(IsUserAdmin())
Exclamation(t_("Warning: Application has administrator/root rights.&This might pose a security risk!"));
else
PromptOK(t_("Application has user rights."));
}