title: Disable Spring Security from spring-security.xml file
body: <p>Help me with the advice please.</p>
  
  <p>I need to disable/enable spring security on my application by some variable in xml file. </p>
  
  <p>my spring-security.xml file</p>
  
  <pre><code>&lt;beans:beans xmlns="http://www.springframework.org/schema/security"
  xmlns:beans="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://www.springframework.org/schema/beans 
      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
      http://www.springframework.org/schema/security 
      http://www.springframework.org/schema/security/spring-security-3.1.xsd"&gt;
  
  &lt;http auto-config="true"&gt;
      &lt;intercept-url pattern="/*" access="ROLE_ADMIN" /&gt;
      &lt;logout logout-success-url="/mainpage" /&gt;
              &lt;login login-success-url="/mainpage" /&gt;
  &lt;/http&gt;
  
  &lt;authentication-manager&gt;
      &lt;authentication-provider&gt;
          &lt;user-service&gt;
              &lt;user name="hey" password="there" authorities="ROLE_ADMIN" /&gt;
          &lt;/user-service&gt;
      &lt;/authentication-provider&gt;
  &lt;/authentication-manager&gt;
  </code></pre>
  
  <p></p>
  
  <p>How can be this perfomed?
  Thanks.</p>