title: Spring Security: allow user only to access their own administration page
body: <p>In my web app users are able to change their user details. The URL for this page is: </p>
  
  <pre><code>springproject/usermanagement/edituserinfo/4
  </code></pre>
  
  <p>where "4" is the user id.</p>
  
  <p>My security-context looks like:</p>
  
  <pre><code>&lt;security:http auto-config="true" use-expressions="true"&gt;
      &lt;security:intercept-url pattern="/usermanagement" access="isAuthenticated()" /&gt;
      &lt;security:intercept-url pattern="/usermanagement/new" access="hasRole('ROLE_ADMIN')" /&gt;
      &lt;security:intercept-url pattern="/usermanagement/edit/*" access="hasRole('ROLE_ADMIN')" /&gt;
      &lt;security:intercept-url pattern="/usermanagement/edituserinfo/*" access="isAuthenticated()" /&gt;  
  &lt;/security:http&gt;
  </code></pre>
  
  <p>How can I restrict the user only to access their own "edituserinfo" page? E.g. user with user id 1 can only access: "springproject/usermanagement/edituserinfo/1 " and not "springproject/usermanagement/edituserinfo/4 "</p>