Vaadin Spring: check if access to view is granted from view name

Hi,
I implemented a ViewAccessControl to work with Spring Security, and now I’m trying to check if a view is granted to user without instantiating it, to enable or not a button.
For this I need to find the bean name from the view name. I found it by scanning the SpringView annotations and using Conventions.deriveMappingForView.
When I have the bean name I can finally call ViewAccessControl.isAccessGranted.
Is there a better way to achieve this?

I found another way to do this, I use directly the view class to check if the user has access to the view.

Here is my SpringSecurityViewAccessControl.
20306.java (2.7 KB)