[ 
https://issues.apache.org/jira/browse/DELTASPIKE-860?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14370909#comment-14370909
 ] 

Ron Smeral commented on DELTASPIKE-860:
---------------------------------------

The @LoggedIn used in that piece of documentation is not meant to be the one 
from PicketLink, there's no mention of that. It's just a hypothetical qualifier 
which could be e.g. used on a producer to produce an instance of a logged in 
user. 

The `@org.picketlink.authorization.annotations.LoggedIn` is meant for a 
different purpose and thus can't and shouldn't have a `PARAMETER`  target: it's 
used on methods and classes to indicate that invocation of a particular method 
or all methods in a class should be intercepted by the SecurityInterceptor.

> documentation says "@LoggedIn User user", but that's impossible
> ---------------------------------------------------------------
>
>                 Key: DELTASPIKE-860
>                 URL: https://issues.apache.org/jira/browse/DELTASPIKE-860
>             Project: DeltaSpike
>          Issue Type: Bug
>            Reporter: The Alchemist
>
> h3. Documentation Snippet
> http://deltaspike.apache.org/documentation/security.html
> {noformat}
> 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
>     }
> }
> {noformat}
> h3. Compilation Error
> {noformat}
> The annotation @LoggedIn is disallowed for this location
> {noformat}
> h3. Explanation?
> I think it's because {{LoggedIn}} is missing a {{@Target}} of {{PARAMETER}}.
> {code:java,title=LoggedIn.java}
> @Retention(value = RetentionPolicy.RUNTIME)
> @Target({ ElementType.TYPE, ElementType.METHOD })
> @Documented
> @SecurityBindingType
> public @interface LoggedIn {
> {code}
> h3. 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?



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to