-
Notifications
You must be signed in to change notification settings - Fork 164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add methods for checking roles and authorities #18700
Conversation
vaadin-spring/src/main/java/com/vaadin/flow/spring/security/AuthenticationContext.java
Outdated
Show resolved
Hide resolved
vaadin-spring/src/main/java/com/vaadin/flow/spring/security/AuthenticationContext.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some nits, but other than that, look good to me
vaadin-spring/src/main/java/com/vaadin/flow/spring/security/AuthenticationContext.java
Outdated
Show resolved
Hide resolved
vaadin-spring/src/main/java/com/vaadin/flow/spring/security/AuthenticationContext.java
Outdated
Show resolved
Hide resolved
vaadin-spring/src/test/java/com/vaadin/flow/spring/security/AuthenticationContextTest.java
Show resolved
Hide resolved
vaadin-spring/src/test/java/com/vaadin/flow/spring/security/AuthenticationContextTest.java
Show resolved
Hide resolved
vaadin-spring/src/test/java/com/vaadin/flow/spring/security/AuthenticationContextTest.java
Show resolved
Hide resolved
Quality Gate passedIssues Measures |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks @peholmst for adding this feature!
I'll create a ticket on docs repository to add a note about this new utility methods in https://vaadin.com/docs/latest/security/enabling-security#security-utilities |
This ticket/PR has been released with Vaadin 24.4.0. |
This PR adds methods for checking the user's roles and authorities. The purpose is to make the
AuthenticationContext
more in line with theuseAuth
hook in Hilla and reduce the need for implementing a custom "security service". In many cases, it should be enough to inject and use theAuthenticationContext
directly.