woopsie
s/boolean user!=null&&user.isadmin();/return user!=null&&user.isadmin();/
-igor
On 2/8/07, Igor Vaynberg <[EMAIL PROTECTED]> wrote:
it is pretty trivial
lets say you have tag interface AdminComponent. all your admin components
implement this interface.
all you have to do is
class MyAuthStrat implements IAuthorizationStrategy {
boolean isInstantioantionAuthorizer() { return true; }
boolean isActionAuthorized(Component c, Action action) {
if (c instanceof AdminComponent) {
if (action.equals(Component.RENDER)||action.equals(
Component.ENABLE)) {
User user= Session.get().getUser();
boolean user!=null&&user.isadmin();
}
}
}
myapplication.init() { getsecuritysettings().setauthostrat(new
myauthstrat()); }
what these few lines of code do is give you an application wide security.
any component that implements AdminComponent interface will now only be
rendered and enabled for admin users.
wicket-auth-role is really an example that demonstrates usecase where
security is defined by a set of preselected roles.
have fun
-igor
On 2/8/07, Sean Sullivan <[EMAIL PROTECTED]> wrote:
> Jonathan,
>
> How can I implement this using a security strategy? Do I need to
> implement my own strategy or does the wicket-auth-roles package take care of
> this automatically?
>
> Sean
>
> On 2/8/07, Jonathan Locke <[EMAIL PROTECTED] > wrote:
> >
> >
> >
> > if your home page is similar for different roles, you might even make
> > one home page and hide/show different panels/components depending
> > on who is signed in. you can /even/ do that automatically using a
> > security
> > strategy because in wicket you can create panels that are only visible
> > to users having certain roles. the advantage there is that you can
> > stick
> > such panels anywhere and not be concerned that the wrong class of use
> > might ever see them.
> >
> >
> >
>
> -------------------------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services,
> security?
> Get stuff done quickly with pre-integrated technology to make your job
> easier.
> Download IBM WebSphere Application Server v.1.0.1 based on Apache
> Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> Wicket-user mailing list
> Wicket-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wicket-user
>
>
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user