Hello, I’d to ask how to create an annotation that can be seen by Vaadin. I have created an Annotation called CustomRolesAllowed that is annotated with PreAuthorize. However, this annotation only works if annotated with @PermitAll and without it I get the error. How can I make this CustomRolesAllowed to work by itself
I am getting the following error:
Reason: Consider adding one of the following annotations to make the view accessible: AnonymousAllowed, PermitAll, RolesAllowed.
Annotations do not work by themselves alone as they are just markers, that require some logic somewhere in your application that is able to read the annotations from the class and then do something.
For example I have a vanilla Vaadin 8 demo application here (no Spring or anything), I define custom annotation like