[jboss-cvs] jboss-seam/examples/seamspace/resources/META-INF ...

Shane Bryzak Shane_Bryzak at symantec.com
Sat Jan 27 09:05:38 EST 2007


  User: sbryzak2
  Date: 07/01/27 09:05:38

  Modified:    examples/seamspace/resources/META-INF  security-rules.drl
  Log:
  added friend's comments page
  
  Revision  Changes    Path
  1.5       +15 -3     jboss-seam/examples/seamspace/resources/META-INF/security-rules.drl
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: security-rules.drl
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/examples/seamspace/resources/META-INF/security-rules.drl,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -b -r1.4 -r1.5
  --- security-rules.drl	25 Jan 2007 13:23:59 -0000	1.4
  +++ security-rules.drl	27 Jan 2007 14:05:38 -0000	1.5
  @@ -7,6 +7,7 @@
   import org.jboss.seam.security.SeamPermission;
   
   import org.jboss.seam.example.seamspace.Member;
  +import org.jboss.seam.example.seamspace.MemberFriend;
   import org.jboss.seam.example.seamspace.MemberImage;
   
   rule ViewImage
  @@ -26,8 +27,20 @@
     activation-group "permissions"
   when
     c: PermissionCheck(name == "blog", action == "create", granted == false)
  -  p: Principal()
  -  Member(username == (p.getName()))
  +  Principal(nm : name)
  +  Member(username == nm)
  +then
  +  c.grant();
  +  modify(c);
  +end;
  +
  +rule CreateFriendComment
  +  no-loop
  +  activation-group "permissions"
  +when
  +  c: PermissionCheck(name == "friendComment", action == "create", granted == false)
  +  Principal(nm : name)
  +  MemberFriend(authorized == true, f : friend -> (f.getUsername().equals(nm)))
   then
     c.grant();
     modify(c);
  @@ -42,4 +55,3 @@
   then
     c.grant();
   end;
  -
  
  
  



More information about the jboss-cvs-commits mailing list