From: Chris W. <ch...@cw...> - 2005-06-28 15:13:20
|
On Jun 2, 2005, at 5:49 PM, Antti M V=E4h=E4kotam=E4ki wrote: ... > A quick look in the Action class seems to indicate that relatively =20 > few places in the action depend on CTX->request but they are vital =20 > parts like additional assigning, language handle (and thus $action-=20 > >_msg), message passing from request, checking cache (because of an =20= > admin check and cache params in request) and fetching parameters =20 > from request. Actually in most of these places (except the cache) and an explicit =20 call (like param_from_request()) we do a CTX->request and only if it =20 returns something use it. So in execute() we have: my $request =3D CTX->request; if ( $request ) { ... do stuff with $request.... So if you're creating actions in by themselves without a request =20 available it should just do the right thing. Are you not seeing this? > .... > Also after this, could it be possible to find out the task and =20 > additional parameters before execute? > Now they are all being gathered in execute and it is thus pretty =20 > hard to do any security checks, or anything else, before the =20 > determined task is executed. So when you create an Action, it is =20 > pretty much a black box and you can just fire execute off and see =20 > what happens, since you can't know which task it chooses to execute =20= > and thus which additional parameters it will have set.. This is a good idea, although we'll have to add a couple more =20 properties so that we don't recheck the task validity and reassign =20 params. (Not a big deal.). Did you create a JIRA task for this? Chris -- Chris Winters (ch...@cw...) Building enterprise-capable snack solutions since 1988. |