Package org.jenkinsci.remoting
Class RoleChecker
java.lang.Object
org.jenkinsci.remoting.RoleChecker
Verifies that the callable is getting run on the intended recipient.
- Since:
- 2.47
- Author:
- Kohsuke Kawaguchi
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract void
check
(RoleSensitive subject, Collection<Role> expected) Called fromRoleSensitive.checkRoles(RoleChecker)
to ensure that this side of the channel is willing to executeCallable
s that expects one of the given roles on their intended recipients.void
check
(RoleSensitive subject, Role expected) void
check
(RoleSensitive subject, Role... expected)
-
Constructor Details
-
RoleChecker
public RoleChecker()
-
-
Method Details
-
check
public abstract void check(@NonNull RoleSensitive subject, @NonNull Collection<Role> expected) throws SecurityException Called fromRoleSensitive.checkRoles(RoleChecker)
to ensure that this side of the channel is willing to executeCallable
s that expects one of the given roles on their intended recipients.If you think you need to implement
RoleSensitive.checkRoles(org.jenkinsci.remoting.RoleChecker)
please reread that method’s Javadoc.Normally, each side of the channel has a fixed set of roles (say
actualRoles
), and the implementation would beactualRoles.containsAll(roles)
.- Parameters:
subject
- Object whose role we are checking right now. Useful context information when reporting an error.expected
- The current JVM that executes the callable should have one of these roles. Never empty nor null.- Throws:
SecurityException
- Any exception thrown will prevent the callable from getting executed, but we recommendSecurityException
-
check
- Throws:
SecurityException
-
check
- Throws:
SecurityException
-