Annotation Type AuthorizeInstantiation


  • @Retention(RUNTIME)
    @Target({PACKAGE,TYPE})
    @Documented
    @Inherited
    public @interface AuthorizeInstantiation
    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;
     
    Author:
    Eelco hillenius
    See Also:
    IAuthorizationStrategy, AnnotationsRoleAuthorizationStrategy, AuthorizeActions, AuthorizeAction
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      String[] value
      Gets the roles that are allowed to take the action.
    • Element Detail

      • value

        String[] value
        Gets the roles that are allowed to take the action.
        Returns:
        the roles that are allowed. Returns a zero length array by default
        Default:
        {}