Loading...
Important Notice - Forums is archived

To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Product icon
TUTORIAL

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.

spring security ACL base menu generation

chatura kalansooriya
6 years ago Jun 04, 2015 6:16pm

I need your valuable thoughts about my idea.  I already implemented some kind of menu bar component which is similar as vaadin4spring sidebar. 

Also, I would like to introduce an annotation base permissions to my menu items which  controls the menu generation base on defined ACL. We are currently using vaadin4spring security extension, hence we can use that features as well. 

1. Can I reuse the spring @PreAuthorize annotations for this? If this possible, its leads, clean usage of existing APIs
2. If not, let me know any staring point  to use existing spring security EL in our own custom annotations. 

Please check the template i created as vaadin view implementation.

@UIScope
@SpringView(name = AboutView.VIEW_NAME)
@MenuSelection(caption=AboutView.VIEW_NAME,ui=MainUI.class,order=3)
@FontAwesomeIcon(FontAwesome.BUG)
@PreAuthorize("hasRole('ROLE_ADMIN')") // existing spring annotation, need to view this menu selection for admin user only
public class AboutViewImpl extends AbstractView<AboutPresenter>  {
    
    @Autowired
    private EventBus.UIEventBus eventBus;
    public AboutViewImpl() {
        
    }
    @Override
    public void enter(ViewChangeEvent event) {
}