com.arsdigita.toolbox.ui
Class ApplicationAuthenticationListener
java.lang.Object
com.arsdigita.toolbox.ui.ApplicationAuthenticationListener
- All Implemented Interfaces:
- EventListener, RequestListener
- public class ApplicationAuthenticationListener
- extends Object
- implements RequestListener
A request listener that checks a privilege against
the current resource as accessed from Kernel.getContext().getResource()
For example, to restrict a page to admin users only:
Page page = PageFactory.buildPage("myapp", "My Admin Page");
page.addRequestListener(new ApplicationAuthenticationListener());
page.lock();
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ApplicationAuthenticationListener
public ApplicationAuthenticationListener()
- Creates a listener that checks for ADMIN privilege
ApplicationAuthenticationListener
public ApplicationAuthenticationListener(PrivilegeDescriptor privilege)
- Creates a listener that checks for an arbitrary
privilege
- Parameters:
privilege
- the privilege to check for
pageRequested
public void pageRequested(RequestEvent event)
- Checks whether the user is logged in. If not, redirects the client
to the login page.
- Specified by:
pageRequested
in interface RequestListener
Copyright (c) 2004 Red Hat, Inc. Corporation. All Rights Reserved. Generated at July 20 2004:2337 UTC