[
http://jira.jboss.com/jira/browse/JBSEAM-1020?page=comments#action_12355800 ]
Christian Bauer commented on JBSEAM-1020:
-----------------------------------------
So it's not only happening with the the logger turned on:
Caused by: org.drools.spi.ConsequenceException: java.lang.ClassCastException:
org.jboss.seam.wiki.core.model.Role
at org.drools.common.DefaultAgenda.fireActivation(Unknown Source)
at org.drools.common.DefaultAgenda.fireNextItem(Unknown Source)
at org.drools.common.AbstractWorkingMemory.fireAllRules(Unknown Source)
at org.drools.common.AbstractWorkingMemory.fireAllRules(Unknown Source)
at
org.jboss.seam.security.RuleBasedIdentity.hasPermission(RuleBasedIdentity.java:135)
at org.jboss.seam.security.Identity.checkPermission(Identity.java:434)
at
org.jboss.seam.wiki.core.action.NodeHome.checkNodeAccessLevelChangePermission(NodeHome.java:194)
at org.jboss.seam.wiki.core.action.DocumentHome.update(DocumentHome.java:50)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.seam.util.Reflections.invoke(Reflections.java:20)
at
org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
at
org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:57)
at
org.jboss.seam.interceptors.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:47)
at
org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:69)
at
org.jboss.seam.interceptors.ManagedEntityIdentityInterceptor.aroundInvoke(ManagedEntityIdentityInterceptor.java:37)
at
org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:69)
at
org.jboss.seam.interceptors.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:34)
at
org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:69)
at
org.jboss.seam.interceptors.TransactionInterceptor$1.work(TransactionInterceptor.java:32)
at org.jboss.seam.util.Work.workInTransaction(Work.java:37)
at
org.jboss.seam.interceptors.TransactionInterceptor.aroundInvoke(TransactionInterceptor.java:27)
at
org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:69)
at
org.jboss.seam.interceptors.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:27)
at
org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:69)
at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:103)
at
org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:151)
at
org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:87)
at
org.jboss.seam.wiki.core.action.DocumentHome_$$_javassist_294.update(DocumentHome_$$_javassist_294.java)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at com.sun.el.parser.AstValue.invoke(Unknown Source)
at com.sun.el.MethodExpressionImpl.invoke(Unknown Source)
at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
at com.sun.facelets.el.LegacyMethodBinding.invoke(LegacyMethodBinding.java:69)
... 49 more
Caused by: java.lang.ClassCastException: org.jboss.seam.wiki.core.model.Role
at
Permissions.Rule_RestrictRaiseAccessLevel_0ConsequenceInvoker.evaluate(Rule_RestrictRaiseAccessLevel_0ConsequenceInvoker.java:19)
... 88 more
import org.jboss.seam.security.PermissionCheck;
import org.jboss.seam.wiki.core.model.Node;
import org.jboss.seam.wiki.core.model.Document;
import org.jboss.seam.wiki.core.model.Directory;
import org.jboss.seam.wiki.core.model.File;
import org.jboss.seam.wiki.core.model.User;
import org.jboss.seam.wiki.core.model.Role;
rule RestrictRaiseAccessLevel
no-loop;
activation-group "permissions"
when
c: PermissionCheck(name == "Node", action ==
"changeAccessLevel");
n: Node(desiredWriteAccessLevel : writeAccessLevel, desiredReadAccessLevel :
readAccessLevel, nodeCreator : createdBy)
r: Role(userAccessLevel : accessLevel -> (desiredReadAccessLevel.intValue() <=
userAccessLevel.intValue() && desiredWriteAccessLevel.intValue() <=
userAccessLevel.intValue()) )
or
User(authenticatedUserId : id -> (nodeCreator == null ||
nodeCreator.getId().equals(authenticatedUserId)) )
then
c.grant();
modify(c);
end;
You don't think this justifies an immediate critical bugfix release of the Drools
production version? An M1 is not a production release.
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