dashorst opened a new issue, #1958:
URL: https://github.com/apache/wicket/issues/1958
Applications that protect many pages with the same roles repeat the same
annotation everywhere:
```java
@AuthorizeInstantiation({"roleA", "roleB", "roleC"})
```
Java lets you put that on your own annotation and use it instead:
```java
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
@AuthorizeInstantiation({"roleA", "roleB", "roleC"})
public @interface SomeFeatureAuthorization {}
```
but Wicket only looks for the annotation directly on the class, so the
meta-annotation is ignored.
## Where
`wicket-auth-roles/src/main/java/org/apache/wicket/authroles/authorization/strategies/role/annotations/AnnotationsRoleAuthorizationStrategy.java`,
the `element.getAnnotation(…)` calls for `AuthorizeInstantiation(s)`,
`AuthorizeAction(s)` and `AuthorizeResource`.
## Done when
- An annotation that carries one of the auth-roles annotations is honoured
on a page or component class. Decide whether one level of meta-annotation is
enough, and what happens when the direct and the meta-annotation are both
present.
- Tests in
`wicket-auth-roles/src/test/java/org/apache/wicket/authroles/authorization/strategies/role/annotations/AnnotationsRoleAuthorizationStrategyTest.java`.
- [WICKET-7200](https://issues.apache.org/jira/browse/WICKET-7200) is
changing how the same class resolves these annotations. Check its state before
starting, to avoid conflicting changes.
## Background
Originally requested as
[WICKET-6691](https://issues.apache.org/jira/browse/WICKET-6691). A committer
supported the proposal.
---
Part of #1945. This issue is meant for a first contribution to Wicket. To
work on it, leave a comment so others know; a claim without a pull request
lapses after two weeks. Questions are welcome, here on the issue or on
[email protected]. Start your branch from `master`, and see [Send a pull
request to
Wicket](https://wicket.apache.org/contribute/wicket-pull-request.html) for
building and testing.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]