[jboss-user] [JBoss Seam] - Re: Problem w/ 1.1.6 example Security Rules

JohnEChesher do-not-reply at jboss.com
Fri Feb 23 12:55:22 EST 2007


Found the solution myself, so thought I would post, as it may later help someone else...

This appears to be a problem with the example in the 1.1.6 Reference Doc. However, I remembered that the "seamspace" example in the Seam Distribution uses Seam Security, so I looked at the security.drl file in that project.  It has two differences from my code: 
- an import for the Principle class
- a semi-colon after "c.grant()".  
Adding those two things solved my problem.  FYI, here's the relevant snippets from security.drl in the seamspace example:

package SeamSpacePermissions;
  | 
  | import java.security.Principal;
  | 
  | import org.jboss.seam.security.PermissionCheck;
  | import org.jboss.seam.security.Role;
  | 
  | rule ViewImage
  |   no-loop
  |   activation-group "permissions"
  | when
  |   c: PermissionCheck(name == "memberImage", action == "view", granted == false)
  |   img: MemberImage()
  |   eval( img.getMember().getPicture() == img )
  | then
  |   c.grant();
  |   modify(c);
  | end;  



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

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



More information about the jboss-user mailing list