[jbossseam-issues] [JBoss JIRA] Commented: (JBSEAM-1019) Asserted objects should be handled polymorphically

Christian Bauer (JIRA) jira-events at lists.jboss.org
Fri Mar 9 18:47:38 EST 2007


    [ http://jira.jboss.com/jira/browse/JBSEAM-1019?page=comments#action_12355686 ] 
            
Christian Bauer commented on JBSEAM-1019:
-----------------------------------------

This seems to work now, I swear it wasn't earlier. I'll leave this open because I'm sure it will pop up again. Right now I'm working completely blind because you can't debug the LHS of a rule properly.


> Asserted objects should be handled polymorphically
> --------------------------------------------------
>
>                 Key: JBSEAM-1019
>                 URL: http://jira.jboss.com/jira/browse/JBSEAM-1019
>             Project: JBoss Seam
>          Issue Type: Feature Request
>          Components: Security
>            Reporter: Christian Bauer
>         Assigned To: Shane Bryzak
>
> Class hierarchy: Node(Document,Directory)
> I'm asserting an instance of Document into working memory like this:
>     <s:link id="editDoc" styleClass="linkNavigation" action="editDoc" accesskey="E"
>             rendered="#{s:hasPermission('NodeHome', 'edit', currentDocument)}"><u>E</u>dit</s:link>
> This doesn't fire:
> rule RestrictNodeHomeEditAccess
>     no-loop;
>     activation-group "permissions"
> when
>     c: PermissionCheck(name == "NodeHome", action == "edit");
>     Node(nodeWriteAccessLevel : writeAccessLevel, nodeCreator : createdBy)
>     Role(userAccessLevel : name -> (Integer.valueOf(userAccessLevel).intValue() >= nodeWriteAccessLevel.intValue()) )
>     or
>     User(authenticatedUserId : id -> (nodeCreator.getId().equals(authenticatedUserId)) )
> then
>     c.grant();
>     modify(c);
> end;
> This does:
> rule RestrictNodeHomeEditAccess
>     no-loop;
>     activation-group "permissions"
> when
>     c: PermissionCheck(name == "NodeHome", action == "edit");
>     Document(nodeWriteAccessLevel : writeAccessLevel, nodeCreator : createdBy)
>     Role(userAccessLevel : name -> (Integer.valueOf(userAccessLevel).intValue() >= nodeWriteAccessLevel.intValue()) )
>     or
>     User(authenticatedUserId : id -> (nodeCreator.getId().equals(authenticatedUserId)) )
> then
>     c.grant();
>     modify(c);
> end;
> I couldn't find anything in the Drools docs about polymorphism but it looks like Facts are not checked polymorphically. Sad language that is.

-- 
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

        



More information about the seam-issues mailing list