You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Reynaldo Timonera <re...@worldnet.att.net> on 2002/03/24 10:32:14 UTC

Need example on using roles in struts-tiles

Hi,

We are now in the middle of a project and we're using tiles. Does anyone have a sample code on how to use roles in tiles?


Thanks,
Reynaldo

Re: Need example on using roles in struts-tiles

Posted by mharris <mh...@site59.com>.
Hello,

We are trying to do a similar thing (authentication and role-based
security based on user and role info acquired from database). Can
someone point me to a good resource to get started or explain how they
set up their system. Users will number in the thousands and there will
be some dynamic comparison of roles, hence setting it up in web.xml
isn't practical.

However, we're not using tiles. The path of the workflow will be based
on roles and whether or not a certain Action can be executed is also
based on roles.

Any advice is much appreciated.

Thanks,
Michelle Harris


On Wed, 2002-03-27 at 20:25, Reynaldo Timonera wrote:
> Thanks Ted.
> 
> We are using database-based authentifiication -- we store our user and role
> in a database. We retrieve these user and role info everytime the user logs
> in and place the info in session scrope. I was thinking  if we can set the
> isUserInRole according to the user's role from the database and not from the
> container's web.xml. So I guess the question would be: is it still possible
> to use the security role of tiles for this setup -- database-based.
> 
> 
> Thanks again,
> 
> Reynaldo
> 
> ----- Original Message -----
> From: "Ted Husted" <hu...@apache.org>
> To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> Sent: Wednesday, March 27, 2002 8:43 AM
> Subject: Re: Need example on using roles in struts-tiles
> 
> 
> > When container-based authentification is being used, you can specify the
> > secuirty role for a tile. If the user is not in the specified role, then
> > the attribute value is not set. This allows you to specify a tile for
> > each security role, and let the framework select the appropriate one for
> > the current user.
> >
> > <tiles:put name="title"  value="myValue" role="myManager"/>
> > <tiles:put name="title"  value="myValue" role="myStaff"/>
> >
> > If the put command is being used in an insert tag, the role is checked
> > immediately.  If the put command is being used within a definition tag,
> > the role is checked when the Tile context is initialized
> >
> > Jakarta taglibs also has a handy IsUserInRole tag in the request taglib.
> >
> > http://jakarta.apache.org/taglibs/doc/request-doc/index.html
> >
> > -- Ted Husted, Husted dot Com, Fairport NY US
> > -- Developing Java Web Applications with Struts
> > -- Tel: +1 585 737-3463
> > -- Web: http://husted.com/about/services
> >
> >
> > Reynaldo Timonera wrote:
> > >
> > > Hi,
> > >
> > > We are now in the middle of a project and we're using tiles. Does anyone
> have a sample code on how to use roles in tiles?
> > >
> > > Thanks,
> > > Reynaldo
> >
> > --
> > To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> > For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> >
> >
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Need example on using roles in struts-tiles

Posted by Reynaldo Timonera <re...@worldnet.att.net>.
Thanks Ted.

We are using database-based authentifiication -- we store our user and role
in a database. We retrieve these user and role info everytime the user logs
in and place the info in session scrope. I was thinking  if we can set the
isUserInRole according to the user's role from the database and not from the
container's web.xml. So I guess the question would be: is it still possible
to use the security role of tiles for this setup -- database-based.


Thanks again,

Reynaldo

----- Original Message -----
From: "Ted Husted" <hu...@apache.org>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Wednesday, March 27, 2002 8:43 AM
Subject: Re: Need example on using roles in struts-tiles


> When container-based authentification is being used, you can specify the
> secuirty role for a tile. If the user is not in the specified role, then
> the attribute value is not set. This allows you to specify a tile for
> each security role, and let the framework select the appropriate one for
> the current user.
>
> <tiles:put name="title"  value="myValue" role="myManager"/>
> <tiles:put name="title"  value="myValue" role="myStaff"/>
>
> If the put command is being used in an insert tag, the role is checked
> immediately.  If the put command is being used within a definition tag,
> the role is checked when the Tile context is initialized
>
> Jakarta taglibs also has a handy IsUserInRole tag in the request taglib.
>
> http://jakarta.apache.org/taglibs/doc/request-doc/index.html
>
> -- Ted Husted, Husted dot Com, Fairport NY US
> -- Developing Java Web Applications with Struts
> -- Tel: +1 585 737-3463
> -- Web: http://husted.com/about/services
>
>
> Reynaldo Timonera wrote:
> >
> > Hi,
> >
> > We are now in the middle of a project and we're using tiles. Does anyone
have a sample code on how to use roles in tiles?
> >
> > Thanks,
> > Reynaldo
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Need example on using roles in struts-tiles

Posted by Ted Husted <hu...@apache.org>.
When container-based authentification is being used, you can specify the
secuirty role for a tile. If the user is not in the specified role, then
the attribute value is not set. This allows you to specify a tile for
each security role, and let the framework select the appropriate one for
the current user.

<tiles:put name="title"  value="myValue" role="myManager"/>
<tiles:put name="title"  value="myValue" role="myStaff"/>

If the put command is being used in an insert tag, the role is checked
immediately.  If the put command is being used within a definition tag,
the role is checked when the Tile context is initialized 

Jakarta taglibs also has a handy IsUserInRole tag in the request taglib. 

http://jakarta.apache.org/taglibs/doc/request-doc/index.html

-- Ted Husted, Husted dot Com, Fairport NY US
-- Developing Java Web Applications with Struts
-- Tel: +1 585 737-3463
-- Web: http://husted.com/about/services


Reynaldo Timonera wrote:
> 
> Hi,
> 
> We are now in the middle of a project and we're using tiles. Does anyone have a sample code on how to use roles in tiles?
> 
> Thanks,
> Reynaldo

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>