[jboss-user] [JBoss Seam] - Re: Security - Define dynamic Role in application

markfoerstein do-not-reply at jboss.com
Fri May 11 20:15:01 EDT 2007


Well, not quite, but what was really happening isn't far from weird.

I managed to solve the problem by changing from this:
GrantedPermission(n : name -> (n == check.getName()), a : action -> (a == check.getAction()))

To this:
GrantedPermission(n : name -> (n.equals(check.getName())), a : action -> (a.equals(check.getAction())))

...which is pretty much the same Shane told me to use in his first post. The thing is, if you use the '==' operator, that line won't evaluate to true, even if you indeed have into the working memory a GrantedPermission object with the name and action being checked.

When you use equals() instead of '==', it works. I really don't know why, since the drools 3 docs say in all examples that you should use '==' for string comparison. There isn't a single example using equals().

And that's all to it. No change in any of the previous code. Just that. Im happy now!

I've done some testing, and permission checking is working fine.

I will post all the code again, so it could help others.

Thanks Shane!.

And thanks Emerson. I'm from Brazil. Are you too? Maybe we can share some personal experiences on Seam app development. Let me know if you would like that.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4045160#4045160

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4045160



More information about the jboss-user mailing list