Class RejectedAccessException

java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
java.lang.SecurityException
org.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessException
All Implemented Interfaces:
Serializable

public final class RejectedAccessException extends SecurityException
Thrown when access to a language element was not permitted.
See Also:
  • Constructor Details

    • RejectedAccessException

      public RejectedAccessException(String type, String details)
      Rejects access to a well-described script element. Normally called from StaticWhitelist.rejectMethod(java.lang.reflect.Method) or similar.
      Parameters:
      type - e.g. field
      details - e.g. some.Class fieldName
    • RejectedAccessException

      public RejectedAccessException(String type, String details, String info)
      Rejects access to a well-described script element. Normally called from StaticWhitelist.rejectMethod(java.lang.reflect.Method) or similar.
      Parameters:
      type - e.g. field
      details - e.g. some.Class fieldName
      info - some additional information if appropriate
    • RejectedAccessException

      public RejectedAccessException(String message)
      Rejects access to something which the current StaticWhitelist format could not describe.
      Parameters:
      message - a descriptive message in no particular format
  • Method Details

    • getSignature

      @CheckForNull public String getSignature()
      Gets the signature of the member to which access was rejected.
      Returns:
      a line in the format understood by StaticWhitelist, or null in case something was rejected for which a known exemption is not available
    • isDangerous

      public boolean isDangerous()
      True if getSignature() is non-null but it would be a bad idea for an administrator to approve it.
      Since:
      1.16
    • setDangerous

      public void setDangerous(boolean dangerous)
      You may set this flag if you think it would be a security risk for this signature to be approved.
      Throws:
      IllegalArgumentException - in case you tried to set this to true when using the nonspecific RejectedAccessException(String) constructor
      Since:
      1.16