Example usage for org.apache.wicket Session getAuthorizationStrategy

List of usage examples for org.apache.wicket Session getAuthorizationStrategy

Introduction

In this page you can find the example usage for org.apache.wicket Session getAuthorizationStrategy.

Prototype

public IAuthorizationStrategy getAuthorizationStrategy() 

Source Link

Usage

From source file:org.wicketstuff.security.components.SecureComponentHelper.java

License:Apache License

/**
 * Gets the {@link WaspAuthorizationStrategy}.
 * //www.j  a  va  2  s.co  m
 * @return the strategy
 * @throws WicketRuntimeException
 *             if a {@link WaspSession} is not found
 * @throws ClassCastException
 *             if the session does not contain a {@link WaspAuthorizationStrategy}
 */
private static WaspAuthorizationStrategy getStrategy() {
    Session session = Session.get();
    if (session instanceof WaspSession)
        return (WaspAuthorizationStrategy) session.getAuthorizationStrategy();
    throw new WicketRuntimeException(session + " is not a " + WaspSession.class);
}