[
https://issues.apache.org/jira/browse/DELTASPIKE-860?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14371243#comment-14371243
]
Ron Smeral commented on DELTASPIKE-860:
---------------------------------------
Yeah, the docs could definitely be more clear on this.
I think we could correct this to:
{{public boolean doSecuredCheck(InvocationContext invocationContext,
BeanManager manager, *Identity identity*) throws Exception}}
* that way, the example still proves the same point, that parameter injection
is available in authorizer methods
* Identity is a bean actually available in PicketLink, and it does have a
{{.isLoggedIn()}} method, so no other change is necessary
You can surely submit a PR. The chance of it getting merged soon is the highest
if:
* include the issue ID in the commit message
* put the link to the PR here, in a comment
* assign the correct component in this issue: Documentation
* and maybe decrease priority to minor
> 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)