/** * Uses application level meta data to match roles for component instantiation. * * @see org.apache.wicket.authorization.IAuthorizationStrategy#isInstantiationAuthorized(java.lang.Class) */ @Override public <T extends IRequestableComponent> boolean isInstantiationAuthorized( final Class<T> componentClass) { if (componentClass == null) { throw new IllegalArgumentException("argument componentClass cannot be null"); } // as long as the interface does not use generics, we should check this if (!Component.class.isAssignableFrom(componentClass)) { throw new IllegalArgumentException("argument componentClass must be of type " + Component.class.getName()); } final Roles roles = rolesAuthorizedToInstantiate(componentClass); if (roles != null) { return hasAny(roles); } return true; }
/** * Uses application level meta data to match roles for component instantiation. * * @see org.apache.wicket.authorization.IAuthorizationStrategy#isInstantiationAuthorized(java.lang.Class) */ @Override public <T extends IRequestableComponent> boolean isInstantiationAuthorized( final Class<T> componentClass) { if (componentClass == null) { throw new IllegalArgumentException("argument componentClass cannot be null"); } // as long as the interface does not use generics, we should check this if (!Component.class.isAssignableFrom(componentClass)) { throw new IllegalArgumentException("argument componentClass must be of type " + Component.class.getName()); } final Roles roles = rolesAuthorizedToInstantiate(componentClass); if (roles != null) { return hasAny(roles); } return true; }