In addition to what Pawel is saying, be careful that you also check
the 'canEditCustomer(target)' call in the target action since there is
nothing to stop someone from figuring out the URL pattern and editing
people they weren't intended to edit.

-Wes

2009/9/23 Paweł Wielgus <poulw...@gmail.com>:
> Hi Dennis,
> You are nesting tags, it's not possible/permitted,
> what You should do is something like:
> <s:iterator value="..." id="iter"> or <s:iterator value="..." var="iter">
> ....
> <s:if test="user.canEditCustomer(iter)">
>
> Which simply is naming your iterator variable to "iter" and use it in if tag,
> depending on struts2 version it will be id or var.
>
> Best greetings,
> Paweł Wielgus.
>
>
> 2009/9/23 Dennis Atkinson <dennisatkinson...@yahoo.com>:
>> Hi all.
>>
>> In my Struts2 application, I have a collection of Customer objects, and 
>> various users have the rights to edit some of them and not others.  I have 
>> created a Struts iterator tag, and in the iterator, I put the various 
>> Customer attributes into an HTML table.  All this works.
>>
>> In one cell of the table, I have the string "Edit", and if it's clicked, it 
>> goes to another Action class to edit that particular Customer object.  All 
>> that works too.
>>
>> What I want to do is only show the "Edit" string if the user has the right 
>> to edit that Customer.  I'm trying to set a "<s:if" tag to do this, but I am 
>> sure I'm not doing it right (because it's not working).
>>
>> I am trying:
>>
>> <s:if test="%{user.canEditCustomer(<s:property>)}">
>>
>> hoping "property" is the current object in the iteration.  But whatever is 
>> happening, this doesn't do what I hope it does.  Am I anywhere close to the 
>> right solution here?
>>
>> Thanks,
>> Dennis
>>
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>



-- 
Wes Wannemacher

Head Engineer, WanTii, Inc.
Need Training? Struts, Spring, Maven, Tomcat...
Ask me for a quote!

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org

Reply via email to