Example usage for org.apache.wicket.authorization IAuthorizationStrategy isInstantiationAuthorized

List of usage examples for org.apache.wicket.authorization IAuthorizationStrategy isInstantiationAuthorized

Introduction

In this page you can find the example usage for org.apache.wicket.authorization IAuthorizationStrategy isInstantiationAuthorized.

Prototype

<T extends IRequestableComponent> boolean isInstantiationAuthorized(Class<T> componentClass);

Source Link

Document

Checks whether an instance of the given component class may be created.

Usage

From source file:br.com.ieptbto.cra.security.UserRoleAuthorizationStrategy.java

License:Open Source License

@Override
public <T extends IRequestableComponent> boolean isInstantiationAuthorized(Class<T> componentClass) {
    for (IAuthorizationStrategy strategy : strategies) {
        if (strategy.isInstantiationAuthorized(componentClass) == false) {
            ISecureApplication app = (ISecureApplication) Application.get();
            throw new RestartResponseAtInterceptPageException(app.getLoginPage());
        }/*w ww .j a  v  a 2  s . c om*/
    }
    return true;
}