3 Replies Latest reply on Dec 23, 2011 12:18 AM by lightguard

    Seam 3 security - annotations member access

    baecks

      Hello,


      I set up security for my SEMA 3 (faces) application. Doing so means defining a number of enums and applying annotations (example below):


      @ViewConfig
      public interface Pages {
           static enum Pages1 {
                //@FacesRedirect
                @ViewPattern("/app/*")
                // @AccessDeniedView("/denied.xhtml")
                @LoginView("/login.xhtml")
                @User(foo = "test")
                ALL;
           }



      With @User defined like this:


      @SecurityBindingType
      @Retention(RetentionPolicy.RUNTIME)
      @Target({ElementType.TYPE, ElementType.FIELD, ElementType.METHOD})
      public @interface User {
           @Nonbinding String foo() default "ALL";
      }




      I'd now like to write one (and only one) authorizer method for @User, in which I can get access to the foo property that of the annotation applied to the enum for which the method is executed. I would be something like this:




      @Secures @User boolean validate(){
        if(@User.foo().isEmpty()) return false;
      }





      I'd appreciate if somebody could let me know if/home this is possible in Seam 3.


      Thanks,
      Sven.