title: Detect if user is admin
body: <p>So, I want to know if a user has run the application with administrator privileges -- irrespective of the OS the person is on.  </p>
  
  <p>I found the solution for Windows (from a website):  </p>
  
  <pre><code>public static boolean isAdmin() {
      String groups[] = (new com.sun.security.auth.module.NTSystem()).getGroupIDs();
      for (String group : groups) {
          if (group.equals("S-1-5-32-544"))
              return true;
      }
      return false;
  }  
  </code></pre>
  
  <p>What about Mac and Ubuntu ?</p>