Uploaded image for project: 'DeltaSpike'
  1. DeltaSpike
  2. DELTASPIKE-860

documentation says "@LoggedIn User user", but that's impossible

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 1.4.0
    • Documentation
    • None

    Description

      Documentation Snippet

      http://deltaspike.apache.org/documentation/security.html

      Create the Authorizer
      @ApplicationScoped
      public class CustomAuthorizer
      {
          @Secures
          @CustomSecurityBinding
          public boolean doSecuredCheck(InvocationContext invocationContext, BeanManager manager, @LoggedIn User user) throws Exception
          {
              return user.isLoggedIn(); // perform security check
          }
      }
      

      Compilation Error

      The annotation @LoggedIn is disallowed for this location
      

      Explanation?

      I think it's because LoggedIn is missing a @Target of PARAMETER.

      @Retention(value = RetentionPolicy.RUNTIME)
      @Target({ ElementType.TYPE, ElementType.METHOD })
      @Documented
      @SecurityBindingType
      public @interface LoggedIn {
      

      Conclusion

      Not sure if this is supposed to work, given that LoggedIn is part of PicketLink, not DeltaSpike.

      Is there a workaround for this type of situation?

      Attachments

        Activity

          People

            rafabene Rafael Benevides
            the_alchemist The Alchemist
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: