RE: Assigning an Action to an onClick handler

2008-12-18 Thread Heikki Uotinen
Maybe

MetaDataRoleAuthorizationStrategy.authorize(link3, Component.ENABLE, ADMIN);

-Heikki

-Original Message-
From: Arie Fishler [mailto:arie@gmail.com] 
Sent: 18. joulukuuta 2008 16:08
To: users@wicket.apache.org
Subject: Assigning an Action to an onClick handler

We are using the AnnotationsRoleAuthorizationStrategy class and place
@AuthorizeInstantiation(ROLE_USER) on restricted Wicket pages.

We need finer-grained authorisation control - we have a class that has 3
AjaxLinks each with their own onClick() handler.  2 of the onClick()
handlers are accessible to everyone but 1 requires an authorised user.  We
have seen it's possible to define a
*org.apache.wicket.authorization.Action*class and allocate it to a
given role BUT how do we associate the given
*Action *to the given onClick() handler?

Many thanks
Arie

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



Re: Assigning an Action to an onClick handler

2008-12-18 Thread Heikki Uotinen
Maybe something like

MetaDataRoleAuthorizationStrategy.authorize(link3, Component.ENABLE, ADMIN);

-Heikki

-Original Message-
From: Arie Fishler [mailto:arie@gmail.com] 
Sent: 18. joulukuuta 2008 16:08
To: users@wicket.apache.org
Subject: Assigning an Action to an onClick handler

We are using the AnnotationsRoleAuthorizationStrategy class and place
@AuthorizeInstantiation(ROLE_USER) on restricted Wicket pages.

We need finer-grained authorisation control - we have a class that has 3
AjaxLinks each with their own onClick() handler.  2 of the onClick()
handlers are accessible to everyone but 1 requires an authorised user.  We
have seen it's possible to define a
*org.apache.wicket.authorization.Action*class and allocate it to a
given role BUT how do we associate the given
*Action *to the given onClick() handler?

Many thanks
Arie

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



Re: Assigning an Action to an onClick handler

2008-12-18 Thread Arie Fishler
Basically we have no problem assigning logic to disable the link when
creating the page. What we want to achieve via the authorization strategy is
a redirect to the sign in page just the same as if a user has accessed a
page with no sufficient roles (so the user signs in and upon successful
signing in he is redirected back to the page he was supposed to get when
clicking initially)

Thanks,
Arie.

On Thu, Dec 18, 2008 at 4:56 PM, Heikki Uotinen 
heikki.uoti...@syncrontech.com wrote:

 Maybe something like

 MetaDataRoleAuthorizationStrategy.authorize(link3, Component.ENABLE,
 ADMIN);

 -Heikki

 -Original Message-
 From: Arie Fishler [mailto:arie@gmail.com]
 Sent: 18. joulukuuta 2008 16:08
 To: users@wicket.apache.org
 Subject: Assigning an Action to an onClick handler

  We are using the AnnotationsRoleAuthorizationStrategy class and place
 @AuthorizeInstantiation(ROLE_USER) on restricted Wicket pages.

 We need finer-grained authorisation control - we have a class that has 3
 AjaxLinks each with their own onClick() handler.  2 of the onClick()
 handlers are accessible to everyone but 1 requires an authorised user.  We
 have seen it's possible to define a
 *org.apache.wicket.authorization.Action*class and allocate it to a
 given role BUT how do we associate the given
 *Action *to the given onClick() handler?

 Many thanks
 Arie

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