title: Difference between @Secured vs @RolesAllowed in Spring? And the concept of Role Based Security?
body: <p>I am studying Spring Security and I have the following doubts related the difference between the use of the <strong>@Secured</strong> annotation and the <strong>@RolesAllowed</strong> annotation.</p>
  
  <p>I know that both have to been used at <strong>method level</strong>, on my study material I found the followings 2 examples:</p>
  
  <ul>
  <li><p><strong>@RolesAllowed</strong> annotation:</p>
  
  <pre><code>import javax.annotation.security.RolesAllowed;    
  public class ItemManager {
      @RolesAllowed("ROLE_MEMBER")
      public Item findItem(long itemNumber) {
          ...
      }
  }
  </code></pre></li>
  <li><p><strong>@Secured</strong> annotation:</p>
  
  <pre><code>import org.springframework.security.annotation.Secured;
  public class ItemManager {
      @Secured("ROLE_MEMBER")
      public Item findItem(long itemNumber) {
          ...
      }
  }
  </code></pre></li>
  </ul>
  
  <p>It seems to me that these 2 annotations works in the same way. What are the differences? What am I missing?</p>
  
  <p>Another doubt that I have is: what exactly represent the <strong>ROLE_MEMBER</strong>? </p>
  
  <p>I think that this is something like <strong>role based security</strong>, so it could mean something like: <strong>only if the user is a member it could access to the annoted resource</strong> (is it correct?). But where and how is definied the fact that the user have setted this role (it is a member)? How exactly works?</p>
  
  <p>Tnx</p>