private static void checkPermissions(Permissions perms){
  SecurityManager sm=System.getSecurityManager();
  if (sm != null) {
    Enumeration en=perms.elements();
    while (en.hasMoreElements()) {
      sm.checkPermission((Permission)en.nextElement());
    }
  }
}

private static void checkPermissions ( Permissions perms ) { SecurityManager sm = System . getSecurityManager ( ) ; if ( sm != null ) { Enumeration en = perms . elements ( ) ; while ( en . hasMoreElements ( ) ) { sm . checkPermission ( ( Permission ) en . nextElement ( ) ) ; } } }
check that the current access control context has all of the given permissions .
