Call the BSD function getgroups() and look for the presence of the admin group (80).
This may not be useful, though. The human using the computer could have a user account that's not in the admin group, but that human still knows an admin-user's name and password.