只有具有某些权限的用户才能部署到 kie 服务器,其他人不应该。
如何在 kie 服务器上实现拦截器,即如果用户没有某些权限,kieserver 应该抛出错误
要实现这一点,您必须在 kie-server.war 文件的 web.xml 文件中定义某些 REST API 的权限。 具有"部署者"角色的用户只能在"/services/rest/server/containers/"REST端点上执行"PUT/POST"操作。
<security-constraint>
<web-resource-collection>
<web-resource-name>REST web resources</web-resource-name>
<url-pattern>/services/rest/server/containers/*</url-pattern>
<http-method>POST</http-method>
<http-method>PUT</http-method>
</web-resource-collection>
<auth-constraint>
<role-name>deployer</role-name>
</auth-constraint>
</security-constraint>
<security-role>
<role-name>deployer</role-name>
</security-role>