solr权限控制之web界面和Java相关操作
一、在配置solr的时候我们曾在solr的WEB-INF/web.xml中注释一段代码,那段代码就是对权限的控制。只需将注释代码更改为以下即可
<security-constraint>
<web-resource-collection>
<web-resource-name>Restrict access to Solr admin</web-resource-name>
<url-pattern>/*</url-pattern>
<http-method>DELETE</http-method>
<http-method>GET</http-method>
<http-method>POST</http-method>
<http-method>PUT</http-method>
</web-resource-collection>
<auth-constraint>
<role-name>solr</role-name>
<role-name>admin</role-name>
</auth-constraint>
<