public abstract class RoleChecker extends Object
ChannelBuilder.withRoleChecker(RoleChecker)| Constructor and Description |
|---|
RoleChecker() |
| Modifier and Type | Method and Description |
|---|---|
abstract void |
check(RoleSensitive subject,
Collection<Role> expected)
Called from
RoleSensitive.checkRoles(RoleChecker) to ensure that this side of the channel
is willing to execute Callables that expects one of the given roles on their intended recipients. |
void |
check(RoleSensitive subject,
Role... expected) |
void |
check(RoleSensitive subject,
Role expected) |
public abstract void check(@NonNull
RoleSensitive subject,
@NonNull
Collection<Role> expected)
throws SecurityException
RoleSensitive.checkRoles(RoleChecker) to ensure that this side of the channel
is willing to execute Callables 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 be actualRoles.containsAll(roles).
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.SecurityException - Any exception thrown will prevent the callable from getting executed, but we recommend
SecurityExceptionpublic void check(@NonNull
RoleSensitive subject,
@NonNull
Role expected)
throws SecurityException
SecurityExceptionpublic void check(@NonNull
RoleSensitive subject,
Role... expected)
throws SecurityException
SecurityExceptionCopyright © 2004–2022. All rights reserved.