struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Madel,Kurt" <kma...@csmi.com>
Subject Container Managed Security and Dynamic Role variables
Date Thu, 17 Oct 2002 11:46:31 GMT
I am using a customized version of JRun 4's container manager security.  The
app that I am creating requires that projects with a given person_id (pid)
associated to them be editable by those persons.  By customizing the
security class for JRun, I was able to add an individual's person_id to
their roles upon logging into the app (ie pid276).  I am trying to use this
with the logic:present tag to control the display of an edit link.  The
problem is that the person_id's that need to be checked against are dynamic;
that is they are based on what project the user has selected to view the
details of.  The DynaForm bean that I use to populate the page has a
property that returns all the persons' ids in a comma delimited string (ie
pid276,pid284).  I tried the following and it doesn't work, although the
same scriplet that I included below it prints out: 'pid276'.  And, for
testing, when I hard code pid276 as one of the role= parameters, it works
fine.

doesn't work:

<bean:define id="pids" name="projectDetailForm" property="managerpids" /> 
    <logic:present role="ADMIN,<%=pids%>">     
    	<html:link page="/action/edit_details" paramId="proj_id"
paramName="projectDetailForm" paramProperty="id">Edit</html:link><br>
   	</logic:present>

prints 'pid276':
<%=pids%><br>

works (but obviously not an option, I need dynamic):

<logic:present role="ADMIN,pid276">     
    	<html:link page="/action/edit_details" paramId="proj_id"
paramName="projectDetailForm" paramProperty="id">Edit</html:link><br>
   	</logic:present>


I checked out struts-el, but haven't tried it yet because is seems the
necessary tag doesn't support the role parameter.

I was hoping to avoid my last resort, which is writing a custom tag.

Any ideas??

Thanks

Kurt Madel
Programmer, CSMi
(703) 823-4300 ext. 170



--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>


Mime
View raw message