title: Securing Controller Actions by User in Grails
body: <p>I am using the Grails security plugin on a project.  I am using the annotations on controller actions to restrict access to certain classes of users such as 'ROLE_ADMIN' or  'ROLE_USER'.</p>
  
  <p>(using this as the basis for what I am doing: <a href="http://grails-plugins.github.com/grails-spring-security-core/docs/manual/guide/5%20Configuring%20Request%20Mappings%20to%20Secure%20URLs.html#5.1%20Defining%20Secured%20Annotations" rel="nofollow">http://grails-plugins.github.com/grails-spring-security-core/docs/manual/guide/5%20Configuring%20Request%20Mappings%20to%20Secure%20URLs.html#5.1%20Defining%20Secured%20Annotations</a>)</p>
  
  <p>My question is, how do I restrict an action so a user can only see information about themselves.   For instance, lets say I have a user with id = 1.  If I have an action that shows information about the user at:</p>
  
  <pre><code>mySite/User/Show/1
  </code></pre>
  
  <p>how do I prevent that same user with id=1 from being able to access</p>
  
  <pre><code>mySite/User/Show/2
  </code></pre>
  
  <p>?  Is there a simple way to do this?</p>