[
http://jira.jboss.com/jira/browse/JBSEAM-1020?page=comments#action_12355765 ]
Edson Tirelli commented on JBSEAM-1020:
---------------------------------------
Ok, catching up with the thread:
1. I was not able to reproduce the exception in 3.0.5, but I do believe it happens. 3.0.x
is not much good in handling unbalanced trees. By that I mean you have an "OR"
in your rule where one side of the OR is a Role object and the other side is a User
object. That is making the engine to lose itself and trying to use a User
declaration/extractor to extract Role attributes. This is a bug that is fixed and working
fine in 3.1M1 and later versions. If you can't upgrade to 3.1M1, I strongly suggest
you to work around that creating two rules:
rule RestrictNodeEditAccess1
no-loop;
activation-group "permissions"
when
c: PermissionCheck(name == "Node", action == "edit");
Node(nodeWriteAccessLevel : writeAccessLevel, nodeCreator : createdBy)
Role(userAccessLevel : name -> (Integer.valueOf(userAccessLevel).intValue() >=
nodeWriteAccessLevel.intValue()) )
then
c.grant();
modify(c);
end;
rule RestrictNodeEditAccess2
no-loop;
activation-group "permissions"
when
c: PermissionCheck(name == "Node", action == "edit");
Node(nodeWriteAccessLevel : writeAccessLevel, nodeCreator : createdBy)
User(authenticatedUserId : id -> (nodeCreator.getId().equals(authenticatedUserId))
)
then
c.grant();
modify(c);
end;
I know this is far from ideal from a rules writer, but it is exactly what the engine
does for you behind the scenes (well, at least in 3.1), so no perf implications.... just
anoying for those writing the rules. As soon as it is possible to upgrade, you will stop
having the problem.
2. Working memory loggers provide for now the most detailed available info of the rule
engine internal workings. If that is not enough, it would be good to talk to you guys to
understand the requirement and maybe add features that will comply to them.
Unfortunatelly, it is not possible for now to know which LHS constraints matched and which
didn't match for any given rule. You can know, though, wich rules get matched by what
facts on what time, even if the rule is canceled again before firing.
Hope it helps and let me know if you want more details about it. I will talk to Michael
about your use case and check what we can do to help more.
[]s
Edson
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