11.5.2. Configuring a rules file

11.5.2. Configuring a rules file

Seam Security expects to find a RuleBase component called securityRules which it uses to evaluate permission checks. This is configured in components.xml as follows:

<components xmlns="http://jboss.com/products/seam/components"
            xmlns:core="http://jboss.com/products/seam/core"
            xmlns:security="http://jboss.com/products/seam/security"
            xmlns:drools="http://jboss.com/products/seam/drools"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xsi:schemaLocation=
                "http://jboss.com/products/seam/core 
		     http://jboss.com/products/seam/core-1.2.xsd 
                 http://jboss.com/products/seam/components  
		     http://jboss.com/products/seam/components-1.2.xsd
                 http://jboss.com/products/seam/drools 
		     http://jboss.com/products/seam/drools-1.2.xsd"
                 http://jboss.com/products/seam/security 
		     http://jboss.com/products/seam/security-1.2.xsd">                 
        
   <drools:rule-base name="securityRules">
       <drools:rule-files>
           <value>/META-INF/security.drl</value>
       </drools:rule-files>
   </drools:rule-base>    
   
</components>

Once the RuleBase component is configured, it's time to write the security rules.