Annotation for configuring what roles are allowed for instantiation the annotated component or
package. This annotation can be used for classes and packages. For classes it can be used like this:
// only users with role ADMIN are allowed to create instances of this page, whether it is
// either bookmarkable or not
@AuthorizeInstantiation("ADMIN")
public class AdminAnnotationsBookmarkablePage extends WebPage
For packages the annotation needs to be specified in the
package-info.java
file:
// only users with role ADMIN are allowed to create instances of pages in this package
@AuthorizeInstantiation("ADMIN")
package package_name;
import org.apache.wicket.authroles.authorization.strategies.role.annotations.AuthorizeInstantiation;