Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Using <a href="http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/expressions.html" rel="nofollow noreferrer">Spring EL</a> and <a href="http://static.springsource.org/spring-security/site/docs/3.0.x/reference/el-access.html" rel="nofollow noreferrer">Spring security</a> could get you most of the way. Spring security defines the <strong>@PreAuthorize</strong> annotation which is fired before method invocation and allows you to use Spring 3's new expression engine, such as:</p> <pre><code>@PreAuthorize("#customerId &gt; 0") public Customer getCustomer(int customerId) { .. } </code></pre> <p>or far more advanced rules like the following which ensures that the passed <strong>user</strong> does not have role <strong>ADMIN</strong>.</p> <pre><code>@PreAuthorize("#user.role != T(com.company.Role).ADMIN)") public void saveUser(User user) { .. } </code></pre> <p>You can also provide default values for your contract with the @Value annotation</p> <pre><code>public Customer getCustomer(@Value("#{434}") int customerId) { .. } </code></pre> <p>You can even reference system properties in your value expressions.</p> <p>Setting up Spring security for this purpose is not to hard as you can just create a <a href="http://static.springsource.org/spring-security/site/docs/3.0.x/apidocs/org/springframework/security/core/userdetails/UserDetailsService.html" rel="nofollow noreferrer">UserDetailsService</a> that grants some default role to all users. Alternatively you could make you own custom Spring aspect and then let this use the <a href="http://static.springsource.org/spring/docs/3.0.0.RC2/javadoc-api/org/springframework/expression/spel/standard/SpelExpressionParser.html" rel="nofollow noreferrer">SpelExpressionParser</a> to check method values. </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload