Secure ZK Component Events

From Documentation
Revision as of 03:37, 23 February 2011 by Ashishd (talk | contribs)

Purpose

Secure certain ZK component event such as Button onClick event.

Example

This Example is borrowed from the standard Spring Security tutorial sample and has been modified to work with ZK using ZK Spring Security. You can download the example codes from ZK Spring Essentials Google Code source repository here. You can see this example in action by deploying ZK Spring Essentials web archive and hitting example home page at http://localhost:8080/zkspringessentials/home.zul and you will see following screen. home.zul page is configured to be accessible to anyone.

ZKSpringEssentials SecurityExampleHome.jpg

This table lists links to different pages that users can visit. Here First row provides a way to access Account Listings page. On the account listings page there are buttons to credit or debit certain amount from the specific user's account but only those users who are logged in and have either ROLE_TELLER or ROLE_ADMINISTRATOR role are allowed to perform those operations. If users of this application are not logged in Spring Security is configured to request users to logon. On clicking any of the +$5,-$5,+$20 or -$20 buttons on account listings page presents an ajax login popup. but how does one configure for certain button click event and set certain role based access to the operation performed by button click? We will describe it below but before that lets see the account listing page and login popup

Here is the account listings page screen.

ZKSpringEssentials SecurityExampleListAccounts2.jpg

Secure component events