Class ScriptingContextPermission

java.lang.Object
java.security.Permission
java.security.BasicPermission
org.bzdev.scripting.ScriptingContextPermission
All Implemented Interfaces:
Serializable, Guard

@Deprecated public final class ScriptingContextPermission extends BasicPermission
Deprecated.
The security manager is being removed from Java
Permission to allow the construction of a ScriptingContext or to call the ScriptingContext methods setReader or setWriter, setErrorWriter, or createBindingSwapper to be called. This permission allows specific subclasses of ScriptingContext to be constructed even if a security manager has been installed. It is intended for users of the BZDev library. The actions string should be either empty or comma-separated tokens whose values can be
  • "trusted", which implies the ability to construct a trusted scripting context. When trusted, scripts will be evaluated with no additional access control; otherwise they are evaluated with no permissions.
  • "swapbindings", which implies that the ScriptingContext method createBindingSwapper to be used.
  • "privileged", which implies that the additional privileges are available for the ScriptingContext methods evalScriptPrivileged, doScriptPrivileged, doScriptPrivilegedReturns, and invokePrivateFunction when its second argument is ScriptingContext.PFMode.PRIVILEGED. These additional privileges are the ones granted to the target class' code base. Without this permission, no privileges are granted to these methods.
An actions string (other than an empty string) must not be used if the permission is for the targets java.io.Reader (to allow the ScriptingContext setReader method to be used) or java.io.Writer (to allow the ScriptingContext setErrorWriter or setWriter methods to be used).

In order to create a subclass of ScriptingContext, both the BZDev library code base and the code base of the scripting context subclass must have a ScriptingContextPermission for the subclass.

See Also:
  • Constructor Details

    • ScriptingContextPermission

      public ScriptingContextPermission(String name)
      Deprecated.
      Constructor.
      Parameters:
      name - the fully qualified class name of the subclass of ScriptingContext that will be constructed, or the class names java.io.Reader or java.io.Writer
    • ScriptingContextPermission

      public ScriptingContextPermission(String name, String actions)
      Deprecated.
      Constructor with actions. When the actions string has the value "trusted", that indicates that a subclass of ScriptingContext may be instantiated with a constructor that sets a 'trusted' argument to true.
      Parameters:
      name - the fully qualified class name of the subclass of ScriptingContext that will be constructed, or the class names java.io.Reader or java.io.Writer
      actions - either an empty string, mandatory when name is java.io.Reader or java.io.Writer, or a string made up of any of the comma-separated tokens "trusted", "swapbindings", or "privileged"
      Throws:
      IllegalArgumentException - the actions argument had an illegal value
  • Method Details