[seam-dev] Where is RuleBasedIdentity in Seam 2.1

Shane Bryzak shane.bryzak at jboss.com
Tue Jun 17 08:27:14 EDT 2008


The replacement is RuleBasedPermissionResolver, the configuration of 
which is described in seam21migration.txt in the root of the Seam 
project.  If you want to provide your own simple method for checking 
permissions, you simply need to implement the PermissionResolver 
interface.  Your custom PermissionResolver implementation will be picked 
up automatically during deployment of your Seam application and used for 
permission checks.  I'm still working on documentation for all the new 
security features (there's a ton of stuff to cover) and unfortunately 
the current version of the docs is quite outdated now so probably not 
much use to you. 

Oh and by the way, there's also PersistentPermissionResolver which may 
already meet your requirements.  It allows you to map certain 
permissions to users and roles (stored in a database).  You can see it 
in action in the SeamSpace example.

Shane

Jervis Liu wrote:
> Hi,
>
> I am trying to upgrade drools-jbrms' dependency on Seam from version 
> 2.0 to 2.1 and have been having some fun with the new security 
> features in Seam 2.1. The doc mentions that I need to use 
> RuleBasedIdentity or extend this class if I want to use Drools based 
> security checks, however this class(RuleBasedIdentity) seems have been 
> removed from trunk. So what is the replacement for RuleBasedIdentity 
> in Seam2.1? Any helps will be appreciated.
>
> Another question is that I may want to avoid using rule-based checks, 
> but using sth simple instead, e.g., the "simplified mode" as described 
> by the doc. In this case I need to extend Identity and have a context 
> somewhere to store my own customized permission objects, very similair 
> to what RuleBasedIdentity does in 2.0. Below is a code snippet that 
> works in Seam 2.0
>
> //same user may have different roles for different packages
> public class PackageBasedPermission {
>     private String package;
>     private String role;
>     
>     public String getPackage;() {
>         return package;
>     }
>     public String getRole;() {
>         return role;
>     }
> }
>
> //Assert customized permission object into working memory
> WorkingMemory wm = ((RuleBasedIdentity) 
> Identity.instance()).getSecurityContext();                   
> wm.assertObject(new PackageBasedPermission("package1", "admin"));
> wm.assertObject(new PackageBasedPermission("package2", "guest"));
>
> So the question is if there is any context I can use in Seam to story 
> my customized object similar to the 
> RuleBasedIdentity.getSecurityContext()?
>
> Thanks,
> Jervis Liu
> _______________________________________________
> seam-dev mailing list
> seam-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/seam-dev





More information about the seam-dev mailing list