  | Mailing List | | Home | | Forum Home | | JBoss - Java Application Server | | Tomcat - JSP/Servlet container | | Struts - A MVC web framework | | iText - An open source PDF Java Library | | JDOM - JDOM XML Parser | | J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition | | JSP - A mailing list about Java Server Pages specification and reference | | J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog | | Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology | |
Struts & Hibernate
|
|
|
  | | | Seam security and validating entities | Seam security and validating entities 2007-08-10 - By andrew.rw.robinson
Back I've got the seam rules engine installed and am trying to write a drl file to grant access to my entities. I have a class that is restricted. Relevant beans:
@(protected)("calendar") CustomerCalendar { members : List } CalendarMember { user : User } User { username : String }
The "CustomerCalendar" entity bean is restricted. I want it to be accessed only by users that are logged in and that are members of the calendar.
So my rules text must be something like: if (check is read calendar) and the calendar has a member with the user that is the current logged in user.
My login code has asserted the User object into the security context.
What I've got so far (that is not valid):
| rule "Read calendar" | no-loop | activation-group "permissions" | when | check: PermissionCheck(name == "calendar", action == "read", granted == false) | user: User() | CustomerCalendar(members : members contains CalendarMember(user == user)) | then | check.grant(); | end;
How can I write such a rule? The user guide for drools has extremely simple examples of contains (containing strings, not other objects).
Thanks, Andrew
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic &p=4073152#4073152
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode =reply&p=4073152 __ ____ ____ ____ ____ ____ ____ ____ ____ ____ jboss-user mailing list jboss-user@(protected) https://lists.jboss.org/mailman/listinfo/jboss-user
|
|
 |