Class AclAwareWhitelist
- All Implemented Interfaces:
ExtensionPoint
- Direct Known Subclasses:
AnnotatedWhitelist
ACL.SYSTEM2 user is making them.
First there is a list of unrestricted signatures; these can always be run.
Then there is a (probably much smaller) list of restricted signatures.
These can be run only when the current user is a real user or even Jenkins.ANONYMOUS2, but not when ACL.SYSTEM2.
Restricted methods should be limited to those which actually perform a permissions check, typically using ACL.checkPermission(hudson.security.Permission).
Allowing the system pseudo-user to run these would be dangerous, since we do not know “on whose behalf” a script is running, and this “user” is permitted to do anything.
-
Nested Class Summary
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson -
Constructor Summary
ConstructorsConstructorDescriptionAclAwareWhitelist(Whitelist unrestricted, Whitelist restricted) Creates a delegating whitelist. -
Method Summary
Modifier and TypeMethodDescriptionbooleanpermitsConstructor(Constructor<?> constructor, Object[] args) booleanpermitsFieldGet(Field field, Object receiver) booleanpermitsFieldSet(Field field, Object receiver, Object value) booleanpermitsMethod(Method method, Object receiver, Object[] args) Checks whether a given virtual method may be invoked.booleanpermitsStaticFieldGet(Field field) booleanpermitsStaticFieldSet(Field field, Object value) booleanpermitsStaticMethod(Method method, Object[] args)
-
Constructor Details
-
AclAwareWhitelist
Creates a delegating whitelist.- Parameters:
unrestricted- a general whitelist; anything permitted by this one will be permitted in any contextrestricted- a whitelist of method/constructor calls (field accesses never consulted) for which ACL checks are expected
-
-
Method Details
-
permitsMethod
public boolean permitsMethod(@NonNull Method method, @NonNull Object receiver, @NonNull Object[] args) Description copied from class:WhitelistChecks whether a given virtual method may be invoked.Note that
methodshould not be implementing or overriding a method in a supertype; in such a case the caller must pass that supertype method instead. In other words, call site selection is the responsibility of the caller (such asGroovySandbox), not the whitelist.- Specified by:
permitsMethodin classWhitelist- Parameters:
method- a method defined in the JVMreceiver-this, the receiver of the method callargs- zero or more arguments- Returns:
- true to allow the method to be called, false to reject it
-
permitsConstructor
- Specified by:
permitsConstructorin classWhitelist
-
permitsStaticMethod
- Specified by:
permitsStaticMethodin classWhitelist
-
permitsFieldGet
- Specified by:
permitsFieldGetin classWhitelist
-
permitsFieldSet
- Specified by:
permitsFieldSetin classWhitelist
-
permitsStaticFieldGet
- Specified by:
permitsStaticFieldGetin classWhitelist
-
permitsStaticFieldSet
- Specified by:
permitsStaticFieldSetin classWhitelist
-