Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The java.security.AllPermission class grants all possible permissions to the caller. This facility was included for routine testing purposes to make it less cumbersome to deal with a multitude of permissions or for use when the code is completely trusted. It should never find place in production code.

...

This non-compliant example grants AllPermission to a library (klib). The permission itself is specified in the security policy file used by the SecurityManagersecurity manager. Alternatively, a permission object can be obtained in the code by subclassing the Permission class (or any subclass like BasicPermission) in the java.security package.

Code Block
bgColor#FFcccc
/* grant the klib library AllPermission */ 
grant codebase "file:${klib.home}/j2ee/home/klib.jar" { 
  permission java.security.AllPermission; 
}; 

...