org.hackystat.projectbrowser.page
Class ProjectBrowserPageAuthentication

java.lang.Object
  extended by org.hackystat.projectbrowser.page.ProjectBrowserPageAuthentication
All Implemented Interfaces:
org.apache.wicket.authorization.IAuthorizationStrategy, org.apache.wicket.authorization.IUnauthorizedComponentInstantiationListener

public class ProjectBrowserPageAuthentication
extends java.lang.Object
implements org.apache.wicket.authorization.IAuthorizationStrategy, org.apache.wicket.authorization.IUnauthorizedComponentInstantiationListener

Implements authorization for all pages other than the home page. Users must sign in with their sensorbase email and password.

Author:
Philip Johnson

Field Summary
 
Fields inherited from interface org.apache.wicket.authorization.IAuthorizationStrategy
ALLOW_ALL
 
Constructor Summary
ProjectBrowserPageAuthentication()
          Sets up the authorization strategy.
 
Method Summary
 boolean isActionAuthorized(org.apache.wicket.Component component, org.apache.wicket.authorization.Action action)
          Individual component actions are always authorized.
 boolean isInstantiationAuthorized(java.lang.Class component)
          Page-level retrieval must be authenticated by checking the session instance to see if the user is signed in.
 void onUnauthorizedInstantiation(org.apache.wicket.Component component)
          Upon authentication failure, redirect to home page with a helpful message.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProjectBrowserPageAuthentication

public ProjectBrowserPageAuthentication()
Sets up the authorization strategy.

Method Detail

isActionAuthorized

public boolean isActionAuthorized(org.apache.wicket.Component component,
                                  org.apache.wicket.authorization.Action action)
Individual component actions are always authorized.

Specified by:
isActionAuthorized in interface org.apache.wicket.authorization.IAuthorizationStrategy
Parameters:
component - The component in question.
action - The component in question.
Returns:
Always true.

isInstantiationAuthorized

public boolean isInstantiationAuthorized(java.lang.Class component)
Page-level retrieval must be authenticated by checking the session instance to see if the user is signed in.

Specified by:
isInstantiationAuthorized in interface org.apache.wicket.authorization.IAuthorizationStrategy
Parameters:
component - The component in question.
Returns:
True if this user is signed in with a valid sensorbase user name and password.

onUnauthorizedInstantiation

public void onUnauthorizedInstantiation(org.apache.wicket.Component component)
Upon authentication failure, redirect to home page with a helpful message.

Specified by:
onUnauthorizedInstantiation in interface org.apache.wicket.authorization.IUnauthorizedComponentInstantiationListener
Parameters:
component - The component in question.