title: Spring security hasRole() giving Error 403 - Access is denied
body: <p>I am trying to view a specific page that only the admin can view but I am getting an error every time I make the request. It appears to be with the hasRole() in my security-context file.</p>
  
  <p>The error just says HTTP Status 403 - Access is denied when I make the request to see the admin jsp page</p>
  
  <p>security-context.xml:</p>
  
  <pre><code>&lt;security:http use-expressions="true"&gt;
      &lt;security:intercept-url pattern="/admin" access="hasAnyRole('admin')" /&gt;
      &lt;security:form-login login-page="/login"
          authentication-failure-url="/login?error=true" /&gt;
      &lt;security:logout logout-success-url="/loogedout" /&gt;
      &lt;security:intercept-url pattern="/createoffer" access="isAuthenticated()" /&gt;
      &lt;security:intercept-url pattern="/docreate" access="isAuthenticated()" /&gt;
      &lt;security:intercept-url pattern="/offercreated" access="isAuthenticated()" /&gt;
      &lt;security:intercept-url pattern="/" access="permitAll" /&gt;
      &lt;security:intercept-url pattern="/loggedout" access="permitAll" /&gt;
      &lt;security:intercept-url pattern="/newaccount" access="permitAll" /&gt;
      &lt;security:intercept-url pattern="/createaccount" access="permitAll" /&gt;
      &lt;security:intercept-url pattern="/accountcreated" access="permitAll" /&gt;
      &lt;security:intercept-url pattern="/static/**" access="permitAll" /&gt;
      &lt;security:intercept-url pattern="/login" access="permitAll" /&gt;
      &lt;security:intercept-url pattern="/offers" access="permitAll" /&gt;
      &lt;security:intercept-url pattern="/**" access="denyAll" /&gt;
  &lt;/security:http&gt;
  </code></pre>
  
  <p>My two tables in my database are a user(username, email, enabled, password) and authorities(username, authority).</p>
  
  <p>Could anyone suggest what my error is or how to fix it?</p>