[
http://jira.jboss.com/jira/browse/JBSEAM-1020?page=comments#action_12355774 ]
Michael Neale commented on JBSEAM-1020:
---------------------------------------
Another alternative is to use eval:
when
c: PermissionCheck(name == "Node", action == "edit");
Node(nodeWriteAccessLevel : writeAccessLevel, nodeCreator : createdBy)
Role(userAccessLevel : name -> (Integer.valueOf(userAccessLevel).intValue() >=
nodeWriteAccessLevel.intValue()) )
or
User(authenticatedUserId : id -> (nodeCreator.getId().equals(authenticatedUserId))
)
becomes:
when
c: PermissionCheck(name == "Node", action == "edit");
Node(nodeWriteAccessLevel : writeAccessLevel, nodeCreator : createdBy)
r: Role()
u: User()
eval( r.getUserAccessLevel() >= nodeWriteAccessLevel || u.getAuthenticatedUserId()
== nodeCreator.getId() )
or similar (depending on autoboxing).
Its not *quite* the same, as it requires that there be a User object in working memory,
but that would most definately be the case from what I know of Seam. Slightly unpleasant,
but it could work for now.
Issues with Drools debug logging
--------------------------------
Key: JBSEAM-1020
URL:
http://jira.jboss.com/jira/browse/JBSEAM-1020
Project: JBoss Seam
Issue Type: Bug
Components: Security
Reporter: Christian Bauer
Assigned To: Shane Bryzak
Priority: Minor
I want to see what is going on when my rules are evaluated, according to the Drools docs
this is how:
workingMemory.addEventListener( new DebugWorkingMemoryEventListener() );
I have to do that in code right now, would be nice to be able to configure the identity
component externally in config file. It also doesn't work, at least not in JBoss with
a WAR deployment. I don't see any debug printed on System.out. Task: Ask the drools
guys how we get logging for Seam users.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira