Class ToolPermissions
java.lang.Object
io.jenkins.plugins.mcp.server.tool.ToolPermissions
Turns
@Tool(permissions = ...) ids into Permissions and checks them against a caller.-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanisAllowed(org.springframework.security.core.Authentication auth, Collection<Permission> required) Whetherauthmay use a tool requiringrequired.static List<Permission> Resolves permission ids toPermissions.
-
Method Details
-
resolve
Resolves permission ids toPermissions. An unknown id throws right away, so a typo in a@Toolis caught at startup instead of quietly letting everyone through. -
isAllowed
public static boolean isAllowed(@Nullable org.springframework.security.core.Authentication auth, Collection<Permission> required) Whetherauthmay use a tool requiringrequired. No requirement, or security off, means yes; otherwise the user needs at least one of them. Checked against the Jenkins root, so overall permissions only - not item-level ones.
-