public boolean implies(Permission permission){
  if (!(permission instanceof ExecOptionPermission))   return false;
  ExecOptionPermission p=(ExecOptionPermission)permission;
  if (all_allowed)   return true;
  String pname=p.getName();
  Permission x=permissions.get(pname);
  if (x != null)   return x.implies(permission);
  int last, offset;
  offset=pname.length() - 1;
  while ((last=pname.lastIndexOf(".",offset)) != -1) {
    pname=pname.substring(0,last + 1) + "*";
    x=permissions.get(pname);
    if (x != null) {
      return x.implies(permission);
    }
    offset=last - 1;
  }
  pname=p.getName();
  offset=pname.length() - 1;
  while ((last=pname.lastIndexOf("=",offset)) != -1) {
    pname=pname.substring(0,last + 1) + "*";
    x=permissions.get(pname);
    if (x != null) {
      return x.implies(permission);
    }
    offset=last - 1;
  }
  return false;
}

public boolean implies ( Permission permission ) { if ( ! ( permission instanceof ExecOptionPermission ) ) return false ; ExecOptionPermission p = ( ExecOptionPermission ) permission ; if ( all_allowed ) return true ; String pname = p . getName ( ) ; Permission x = permissions . get ( pname ) ; if ( x != null ) return x . implies ( permission ) ; int last , offset ; offset = pname . length ( ) - 1 ; while ( ( last = pname . lastIndexOf ( "." , offset ) ) != - 1 ) { pname = pname . substring ( 0 , last + 1 ) + "*" ; x = permissions . get ( pname ) ; if ( x != null ) { return x . implies ( permission ) ; } offset = last - 1 ; } pname = p . getName ( ) ; offset = pname . length ( ) - 1 ; while ( ( last = pname . lastIndexOf ( "=" , offset ) ) != - 1 ) { pname = pname . substring ( 0 , last + 1 ) + "*" ; x = permissions . get ( pname ) ; if ( x != null ) { return x . implies ( permission ) ; } offset = last - 1 ; } return false ; }
check and see if this set of permissions implies the permissions expressed in " permission " .
