yeah, that's it and it's impressively powerful for such a simple thing.  but
then that's java objects.  we should really get an example like this on the
wiki at some point...  it might even make a good demo/example in the more
introductory areas of the new site.  it certainly ought to open some eyes
concerning what you can do.


igor.vaynberg 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
>> [email protected]
>> 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
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/wicket-user
> 
> 

-- 
View this message in context: 
http://www.nabble.com/-Wicket-user--How-can-I-have-difference-HomePage-for-difference-role--tf3191903.html#a8879317
Sent from the Wicket - User mailing list archive at Nabble.com.


-------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to