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.
-
-
Constructor Summary
Constructors Constructor Description RejectedAccessException(String message)
Rejects access to something which the currentStaticWhitelist
format could not describe.RejectedAccessException(String type, String details)
Rejects access to a well-described script element.RejectedAccessException(String type, String details, String info)
Rejects access to a well-described script element.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getSignature()
Gets the signature of the member to which access was rejected.boolean
isDangerous()
True ifgetSignature()
is non-null but it would be a bad idea for an administrator to approve it.void
setDangerous(boolean dangerous)
You may set this flag if you think it would be a security risk for this signature to be approved.-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Constructor Detail
-
RejectedAccessException
public RejectedAccessException(String type, String details)
Rejects access to a well-described script element. Normally called fromStaticWhitelist.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 fromStaticWhitelist.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 currentStaticWhitelist
format could not describe.- Parameters:
message
- a descriptive message in no particular format
-
-
Method Detail
-
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 ifgetSignature()
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 nonspecificRejectedAccessException(String)
constructor- Since:
- 1.16
-
-