You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by radone <Ra...@seznam.cz> on 2005/11/25 18:13:28 UTC
detect user roles (somthing like )
Hi,
could anyone help me how to detect roles of user in Tapestry?
Something like (struts)
<html:logic roles="admin"> Amin's text </html:logic>
Thanks in advance.
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: detect user roles (somthing like )
Posted by John Coleman <jo...@ntlworld.com>.
maybe use the if component and some ognl to locate the property in your
visit, if that's where it is
John
----- Original Message -----
From: "radone" <Ra...@seznam.cz>
To: <ta...@jakarta.apache.org>
Sent: Friday, November 25, 2005 5:13 PM
Subject: detect user roles (somthing like <html:logic roles="" >)
> Hi,
>
> could anyone help me how to detect roles of user in Tapestry?
>
> Something like (struts)
> <html:logic roles="admin"> Amin's text </html:logic>
>
> Thanks in advance.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
RE: detect user roles (somthing like )
Posted by Patrick Casey <pa...@adelphia.net>.
I do the same thing, but I'm uncomfortable relying on it as a sole
source of security. Theoretically a user without role X could still submit a
form containing fields for role X (it's just a formatted text string) and
thus punch above his weight.
So I've got a whole *second* layer of security underneath where I
cross reference the transaction with the role to verify authorization. I do
wish there was a way to kill both birds with one stone, but I haven't
figured out what it is yet. (for the similar, but not identical problem of
preventing folks from submitting synthetic GETS instead of POSTS, I've got a
solution though).
--- Pat
> -----Original Message-----
> From: Richard Clark [mailto:rdclark@nextquestion.net]
> Sent: Saturday, November 26, 2005 9:17 PM
> To: Tapestry users
> Subject: Re: detect user roles (somthing like <html:logic roles="" >)
>
> That's basically how I've done it in a production app. I wrote an
> "isAvailableForRole" method and created a Role enumeration, so the
> HTML looks like:
>
> <div jwcid="@Conditional" condition="isAvailableForRole(@myapp@Admin)">
> ...
> </div>
>
> I've started thinking how to cut this over to ACEGI as well (and how
> I could do this in T4...)
>
> ...Richard
>
>
>
> On Nov 26, 2005, at 18:28, Patrick Casey wrote:
>
> >
> > <span jwcid="@Conditional" condition="currentUser.Role == 'foo'">
> > Foo
> > </span>
> >
> > Might work for you.
> >
> >> -----Original Message-----
> >> From: radone [mailto:RadimBurget@seznam.cz]
> >> Sent: Friday, November 25, 2005 9:13 AM
> >> To: tapestry-user@jakarta.apache.org
> >> Subject: detect user roles (somthing like <html:logic roles="" >)
> >>
> >> Hi,
> >>
> >> could anyone help me how to detect roles of user in Tapestry?
> >>
> >> Something like (struts)
> >> <html:logic roles="admin"> Amin's text </html:logic>
> >>
> >> Thanks in advance.
> >>
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> >> For additional commands, e-mail: tapestry-user-
> >> help@jakarta.apache.org
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: detect user roles (somthing like )
Posted by Richard Clark <rd...@nextquestion.net>.
That's basically how I've done it in a production app. I wrote an
"isAvailableForRole" method and created a Role enumeration, so the
HTML looks like:
<div jwcid="@Conditional" condition="isAvailableForRole(@myapp@Admin)">
...
</div>
I've started thinking how to cut this over to ACEGI as well (and how
I could do this in T4...)
...Richard
On Nov 26, 2005, at 18:28, Patrick Casey wrote:
>
> <span jwcid="@Conditional" condition="currentUser.Role == 'foo'">
> Foo
> </span>
>
> Might work for you.
>
>> -----Original Message-----
>> From: radone [mailto:RadimBurget@seznam.cz]
>> Sent: Friday, November 25, 2005 9:13 AM
>> To: tapestry-user@jakarta.apache.org
>> Subject: detect user roles (somthing like <html:logic roles="" >)
>>
>> Hi,
>>
>> could anyone help me how to detect roles of user in Tapestry?
>>
>> Something like (struts)
>> <html:logic roles="admin"> Amin's text </html:logic>
>>
>> Thanks in advance.
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: tapestry-user-
>> help@jakarta.apache.org
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
RE: detect user roles (somthing like )
Posted by Patrick Casey <pa...@adelphia.net>.
<span jwcid="@Conditional" condition="currentUser.Role == 'foo'">
Foo
</span>
Might work for you.
> -----Original Message-----
> From: radone [mailto:RadimBurget@seznam.cz]
> Sent: Friday, November 25, 2005 9:13 AM
> To: tapestry-user@jakarta.apache.org
> Subject: detect user roles (somthing like <html:logic roles="" >)
>
> Hi,
>
> could anyone help me how to detect roles of user in Tapestry?
>
> Something like (struts)
> <html:logic roles="admin"> Amin's text </html:logic>
>
> Thanks in advance.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org