You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by "nebojsa.nedic" <ne...@gmail.com> on 2011/10/27 13:23:24 UTC
@AuthorizeAction multiple actions
Hello all,
I would like to ask is it possible to add multiple authorize actions on one
class.
It would mean that in case the user has role (i.e.) "Admin" component is
enabled and rendered, for role "user" component is disabled and rendered,
and for role "guest" component is not rendered.
Kind of combination of these two annotations:
@AuthorizeAction(action = "ENABLE", roles = { "ROLE_ADMIN" })
@AuthorizeAction(action = "RENDER", roles = { "ROLE_USER" })
What would be the best way to implement this?
Thank you.
--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/AuthorizeAction-multiple-actions-tp3943997p3943997.html
Sent from the Users forum mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: @AuthorizeAction multiple actions
Posted by "nebojsa.nedic" <ne...@gmail.com>.
Thank you very much for your help.
Yes that helped - I did not know for this annotation.
This is the code how it looks like now:
@AuthorizeActions(actions = {
@AuthorizeAction(action = "ENABLE", roles = { "ROLE_ADMIN"
}),
@AuthorizeAction(action = "RENDER", roles = { "ROLE_ADMIN", "ROLE_USER" })
})
At first, I even didn't saw this "s" at the end :).
--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/AuthorizeAction-multiple-actions-tp3943997p3944682.html
Sent from the Users forum mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: @AuthorizeAction multiple actions
Posted by James Carman <ja...@carmanconsulting.com>.
That's what I said! :)
On Oct 27, 2011 8:44 AM, "Martijn Dashorst" <ma...@gmail.com>
wrote:
> This should work I guess?
>
>
> http://wicket.apache.org/apidocs/1.5/org/apache/wicket/authroles/authorization/strategies/role/annotations/AuthorizeActions.html
>
> Martijn
>
> On Thu, Oct 27, 2011 at 2:41 PM, James Carman
> <ja...@carmanconsulting.com> wrote:
> > He had different actions
> > On Oct 27, 2011 7:32 AM, "Martin Grigorov" <mg...@apache.org> wrote:
> >
> >> On Thu, Oct 27, 2011 at 1:23 PM, nebojsa.nedic
> >> <ne...@gmail.com> wrote:
> >> > Hello all,
> >> >
> >> > I would like to ask is it possible to add multiple authorize actions
> on
> >> one
> >> > class.
> >> >
> >> > It would mean that in case the user has role (i.e.) "Admin" component
> is
> >> > enabled and rendered, for role "user" component is disabled and
> rendered,
> >> > and for role "guest" component is not rendered.
> >> >
> >> > Kind of combination of these two annotations:
> >> > @AuthorizeAction(action = "ENABLE", roles = { "ROLE_ADMIN" })
> >> > @AuthorizeAction(action = "RENDER", roles = { "ROLE_USER" })
> >>
> >> @AuthorizeAction(action = "ENABLE", roles = { "ROLE_ADMIN", "ROLE_USER"
> })
> >> @AuthorizeAction(action = "RENDER", roles = { "ROLE_USER" })
> >>
> >> List all roles which are authorized to do the action.
> >> >
> >> > What would be the best way to implement this?
> >> >
> >> > Thank you.
> >> >
> >> > --
> >> > View this message in context:
> >>
> http://apache-wicket.1842946.n4.nabble.com/AuthorizeAction-multiple-actions-tp3943997p3943997.html
> >> > Sent from the Users forum mailing list archive at Nabble.com.
> >> >
> >> > ---------------------------------------------------------------------
> >> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> >> > For additional commands, e-mail: users-help@wicket.apache.org
> >> >
> >> >
> >>
> >>
> >>
> >> --
> >> Martin Grigorov
> >> jWeekend
> >> Training, Consulting, Development
> >> http://jWeekend.com
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> >> For additional commands, e-mail: users-help@wicket.apache.org
> >>
> >>
> >
>
>
>
> --
> Become a Wicket expert, learn from the best: http://wicketinaction.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
Re: @AuthorizeAction multiple actions
Posted by Martijn Dashorst <ma...@gmail.com>.
This should work I guess?
http://wicket.apache.org/apidocs/1.5/org/apache/wicket/authroles/authorization/strategies/role/annotations/AuthorizeActions.html
Martijn
On Thu, Oct 27, 2011 at 2:41 PM, James Carman
<ja...@carmanconsulting.com> wrote:
> He had different actions
> On Oct 27, 2011 7:32 AM, "Martin Grigorov" <mg...@apache.org> wrote:
>
>> On Thu, Oct 27, 2011 at 1:23 PM, nebojsa.nedic
>> <ne...@gmail.com> wrote:
>> > Hello all,
>> >
>> > I would like to ask is it possible to add multiple authorize actions on
>> one
>> > class.
>> >
>> > It would mean that in case the user has role (i.e.) "Admin" component is
>> > enabled and rendered, for role "user" component is disabled and rendered,
>> > and for role "guest" component is not rendered.
>> >
>> > Kind of combination of these two annotations:
>> > @AuthorizeAction(action = "ENABLE", roles = { "ROLE_ADMIN" })
>> > @AuthorizeAction(action = "RENDER", roles = { "ROLE_USER" })
>>
>> @AuthorizeAction(action = "ENABLE", roles = { "ROLE_ADMIN", "ROLE_USER" })
>> @AuthorizeAction(action = "RENDER", roles = { "ROLE_USER" })
>>
>> List all roles which are authorized to do the action.
>> >
>> > What would be the best way to implement this?
>> >
>> > Thank you.
>> >
>> > --
>> > View this message in context:
>> http://apache-wicket.1842946.n4.nabble.com/AuthorizeAction-multiple-actions-tp3943997p3943997.html
>> > Sent from the Users forum mailing list archive at Nabble.com.
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> > For additional commands, e-mail: users-help@wicket.apache.org
>> >
>> >
>>
>>
>>
>> --
>> Martin Grigorov
>> jWeekend
>> Training, Consulting, Development
>> http://jWeekend.com
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
--
Become a Wicket expert, learn from the best: http://wicketinaction.com
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: @AuthorizeAction multiple actions
Posted by James Carman <ja...@carmanconsulting.com>.
He had different actions
On Oct 27, 2011 7:32 AM, "Martin Grigorov" <mg...@apache.org> wrote:
> On Thu, Oct 27, 2011 at 1:23 PM, nebojsa.nedic
> <ne...@gmail.com> wrote:
> > Hello all,
> >
> > I would like to ask is it possible to add multiple authorize actions on
> one
> > class.
> >
> > It would mean that in case the user has role (i.e.) "Admin" component is
> > enabled and rendered, for role "user" component is disabled and rendered,
> > and for role "guest" component is not rendered.
> >
> > Kind of combination of these two annotations:
> > @AuthorizeAction(action = "ENABLE", roles = { "ROLE_ADMIN" })
> > @AuthorizeAction(action = "RENDER", roles = { "ROLE_USER" })
>
> @AuthorizeAction(action = "ENABLE", roles = { "ROLE_ADMIN", "ROLE_USER" })
> @AuthorizeAction(action = "RENDER", roles = { "ROLE_USER" })
>
> List all roles which are authorized to do the action.
> >
> > What would be the best way to implement this?
> >
> > Thank you.
> >
> > --
> > View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/AuthorizeAction-multiple-actions-tp3943997p3943997.html
> > Sent from the Users forum mailing list archive at Nabble.com.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
>
>
>
> --
> Martin Grigorov
> jWeekend
> Training, Consulting, Development
> http://jWeekend.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
Re: @AuthorizeAction multiple actions
Posted by Martin Grigorov <mg...@apache.org>.
On Thu, Oct 27, 2011 at 1:23 PM, nebojsa.nedic
<ne...@gmail.com> wrote:
> Hello all,
>
> I would like to ask is it possible to add multiple authorize actions on one
> class.
>
> It would mean that in case the user has role (i.e.) "Admin" component is
> enabled and rendered, for role "user" component is disabled and rendered,
> and for role "guest" component is not rendered.
>
> Kind of combination of these two annotations:
> @AuthorizeAction(action = "ENABLE", roles = { "ROLE_ADMIN" })
> @AuthorizeAction(action = "RENDER", roles = { "ROLE_USER" })
@AuthorizeAction(action = "ENABLE", roles = { "ROLE_ADMIN", "ROLE_USER" })
@AuthorizeAction(action = "RENDER", roles = { "ROLE_USER" })
List all roles which are authorized to do the action.
>
> What would be the best way to implement this?
>
> Thank you.
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/AuthorizeAction-multiple-actions-tp3943997p3943997.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
--
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org