![]() ![]() I would post an attachment, but the forum says "no more attachments are allowed today." Just like a Windows binary which requests elevation at start, the package they build can also request elevation upon start. Have you seen VMware InstallBuilder for macOS? You can build an "always elevate" package with it for macOS. Yes, I have already come across your amazing work RE: SMJobBless and have even printed out the full article for offline reading. Hope this helps a little bit - feel free to ask questions □ Well, giving the application "rights" for full disk access is not going to cut it - macOS will simply not allow it, UNLESS you're running a helper tool. Just as an example: for one of my tools I would need full access to a disk to read or write a full disk. Especially once you get it - but 3 months later I have to read my own article again □Īs for your AuthorizationItem question: I'm not an expert either, but I did a lot of digging in the Apple documentation.Īs far as I can guess this could point to a tool you'd like to use, but I highly doubt it will run the tool with elevated privileges. It is a quite a bit of info to process, but it is do-able with Lazarus. Hint: Where things often will go wrong is with the plist files. So based on my findings I made a description: SMJobBless or Elevated Privileges you'd need a helper tool for that.Īpple has a SMJobLess example for Obj.C and Swift for that, but even with that It took me a lot of research and testing to figure that one out for Lazarus. This would be a big security issue of course.Īn app on itself cannot run with elevated privileges (Apple's security feature). However, username and password cannot be retrieved like that. It basically confirms admin credentials, if your application would like to validate those. Result := status=errAuthorizationSuccess Status := kAuthorizationEmptyEnvironment, authFlags, authRef) įunction TfmMain.VerifyAdminLogin:boolean ĪuthItem.name := kAuthorizationRightExecute ĪuthFlags := kAuthorizationFlagInteractionAllowed or kAuthorizationFlagExtendRights or kAuthorizationFlagPreAuthorize It triggers a Admin authentication request and returns either TRUE or FALSE. There are under macOS several ways to do this, but to use the proper API call in Lazarus Pascal, you can try this function I created. Sometimes one needs to verify if the user is admin and has the appropriate right to access a certain function. ![]()
0 Comments
Leave a Reply. |