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 Callable s 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 Callable
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 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
SecurityException
public void check(@NonNull RoleSensitive subject, @NonNull Role expected) throws SecurityException
SecurityException
public void check(@NonNull RoleSensitive subject, Role... expected) throws SecurityException
SecurityException
Copyright © 2004–2022. All rights reserved.