The way I handle this is to broadcast a message in SecuredEvent event type that fires off the roles checks, the controller function then uses a SecurityService bean configured in coldspring. Depending on how complex your security is, this might simply accept a struct that maps event name to required roles, or connects to your database to check groups and permissions etc. Chris
2009/7/16 Dan Wilson <[email protected]> > Arguments are child tags of Message tags. > > > For example: > <event-handler name="page.index" type="SecuredEvent"> > <broadcasts> > <message name="NeedStuff"> > <argument name="requiredRole" value="admin" /> <!-- This is the > role I want to pass to my secured event --> > </message> > </broadcasts> > <results> > <result do="view.templateSideNav" /> > </results> > <views> > <include name="body" template="dspIndexSideNav.cfm" /> > </views> > </event-handler> > > Thus, there isn't currently a mechanism to pass an argument to an > event-handler as far as I know. > > > DW > > > > On Wed, Jul 15, 2009 at 5:54 PM, Jeremy Prevost <[email protected]>wrote: > >> >> Hi! >> >> I'm trying to use an EventType to secure my events. I'm not having any >> trouble getting my "SecuredEvent" to trigger before the rest of my >> broadcast. However, what I am having trouble with is passing an >> argument into the SecuredEvent. In short, I want to pass in a required >> role, but define it in my event config. >> >> Here's the type of thing I'm trying to do, but it doesn't work. >> >> <event-handler name="page.index" type="SecuredEvent"> >> <argument name="requiredRole" value="admin" /> <!-- This is the >> role I want to pass to my secured event --> >> <broadcasts> >> <message name="NeedStuff" /> >> </broadcasts> >> <results> >> <result do="view.templateSideNav" /> >> </results> >> <views> >> <include name="body" template="dspIndexSideNav.cfm" /> >> </views> >> </event-handler> >> >> Is this not supported, or am I just having a syntax problem? >> >> Thanks, >> Jeremy >> >> > > > -- > “Come to the edge, he said. They said: We are afraid. Come to the edge, he > said. They came. He pushed them and they flew.” > > Guillaume Apollinaire quotes > > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "model-glue" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/model-glue?hl=en For more about Model-Glue, check http://www.model-glue.com . -~----------~----~----~----~------~----~------~--~---
