Skip to content
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

Circular dependencies with VaadinWebSecurity and NavigationAccessControl #18561

Closed
ILikePhysics opened this issue Jan 29, 2024 · 3 comments
Closed

Comments

@ILikePhysics
Copy link

ILikePhysics commented Jan 29, 2024

Description of the bug

I understand that the documentation (https://vaadin.com/docs/latest/security/advanced-topics/navigation-access-control) suggests to expose a NavigationAccessControlConfigurer bean using a static block so that it produces a configured NavigationAccessControl bean before it eagerly inject it in VaadinWebSecurity when that NavigationAccessControlConfigurer is put in a class extending VaadinWebSecurity. The problem is by doing so, you are no longer able to inject other beans in your NavigationAccessControlConfigurer object if you want, for instance, pass it on some application properties.

Expected behavior

Not having to have to expose a bean in a static method within a class extending VaadinWebSecurity.

Would it be better to inject that NavigationAccessControl bean as a ObjectProvider or ObjectFactory, as suggested in the following post: #18458 (comment)?

Minimal reproducible example

None

Versions

Using Vaadin Flow 24.3.3

@mcollovati
Copy link
Collaborator

mcollovati commented Jan 29, 2024

#18463 introduced the usage of ObjectProvider to inject NavigationAccessControl.

The fix has been released in Flow 24.3.4

@ILikePhysics
Copy link
Author

ILikePhysics commented Jan 29, 2024

oh, I completely missed 24.3.4. Should have better read that other post I guess... Thanks @mcollovati. I will wait for the official 24.3.4 release.

@mcollovati
Copy link
Collaborator

I'm not sure that ObjectProvider will allow using non static methods to define beans required by NavigationAccessControl.
Please reopen the issue if you still encounter errors after upgrading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants