veryfing that user is admin and displaying authentication dialog in macOS lazarus / 33-macOS - Mac OS X ---------------------------------------------------------------------- inferno · 2020-01-02 21:38 Hi all, I need to check if logged user is admin or not. I found this solution: https://www.tweaking4all.com/forums/topic/lazarus-macos-request-admin- authentication/ but cannot get it working with 64 bit target. The following linker error occurs: QuoteError: linker: Undefined symbols for architecture x86_64: Error: linker:   "_AuthorizationCreate", referenced from: Error: ld: symbol(s) not found for architecture x86_64 An error occurred while linking Error: Error while linking The problem is that AuthorizationCreate is not available on x86_64... Any idea how to fix it? Best regards, Inferno ---------------------------------------------------------------------- inferno · 2020-01-02 22:16 After some more digging I found the problem. The solution is described here: https://forum.lazarus.freepascal.org/index.php?topic=16587.0. It is necessary to add {$linkframework Security}. The second question - how to determine what type of user is logged in - admin or not? Best regards, Inferno ---------------------------------------------------------------------- winni · 2020-01-02 23:07 Hi! Try to write a file in /root/ If no error occurs you are root. If an error happens you are a simple user. Winni ---------------------------------------------------------------------- trev · 2020-01-03 00:46 Quote from: winni on January 03, 2020, 12:07:02 amTry to write a file in /root/ If no error occurs you are root. If an error happens you are a simple user. / is a read-only filesystem in Catalina, so even if that worked previously (I doubt it because there is no /root directory - at least in Mojave) it definitely will not work now. ---------------------------------------------------------------------- winni · 2020-01-03 01:36 Oops, wrong OS. ---------------------------------------------------------------------- trev · 2020-01-03 02:20 This looks like what you want: https://developer.apple.com/documentati on/collaboration/cbidentity/1423867-ismemberofgroup Also see: /usr/local/share/fpcsrc/fpc- 3.3.1/packages/cocoaint/src/collaboration/* ---------------------------------------------------------------------- trev · 2020-01-03 06:21 Having thought about this a bit more, the question is whether you really need to know whether the user is an admin or not because the authentication dialog allows any administrator on the computer to authenticate, not just the logged in user.