title: How to define Spring security access
body: <p>Here is my spring-security.xml file. I don't understand how can i define access attribute. There are "ROLE_USER" and "ROLE_ANONYMOUS" as default but how can i define my custom access attribute? For example "admin" value is returning from database and how can i change this access to set admin. </p>
  
  <pre><code>&lt;intercept-url pattern="/**" access="admin" /&gt;
  </code></pre>
  
  <p>Above code is giving error.</p>
  
  <pre><code>    &lt;http auto-config="true"&gt;
      &lt;intercept-url pattern="/pages/login.xhtml*" access="IS_AUTHENTICATED_ANONYMOUSLY"/&gt;
      &lt;intercept-url pattern="/**" access="" /&gt;
      &lt;form-login login-page='/pages/login.xhtml' default-target-url="/**"
                  authentication-failure-url="/pages/login.xhtml"/&gt;
      &lt;logout logout-success-url="/pages/logout.xhtml" /&gt;
  &lt;/http&gt;
  
  &lt;authentication-manager alias="authenticationManager"&gt;
      &lt;authentication-provider&gt;
          &lt;jdbc-user-service data-source-ref="dataSource"
  
         users-by-username-query="
            select username,password 
            from app_user where username=?" 
  
         authorities-by-username-query="
            select u.username, ur.role from app_user u, role ur 
            where u.role = ur.uuid and u.username =?  " 
  
      /&gt;
      &lt;/authentication-provider&gt;
  &lt;/authentication-manager&gt;
  </code></pre>