vaadin / cdi

CDI Integration for Vaadin
Apache License 2.0
41 stars 56 forks source link

CDIViewProvider should allow checking required view roles programmatically from other sources than just annotation #114

Open vaadin-bot opened 10 years ago

vaadin-bot commented 10 years ago

Originally by @peterl1084


Currently it's possible to define @RolesAllowed annotation for @CDIView annotated Vaadin views. This is sufficient in quite many cases but not enough if user wants to check required roles from some configurable role manager where roles for views can be dynamically set.

It would make sense to provide injection point to CDIViewProvider that allows switching role checker implementation not to fix it to rely on @RolesAllowed annotation.

Alternatively it would be sufficient if there was an interface defined which CDIViewProvider would call to determine roles for view. Then it could be used either by injection from CDIViewProvider or it could be given simply with setter.


Imported from https://dev.vaadin.com/ issue #14661

vaadin-bot commented 10 years ago

Originally by @Legioth


What about adding your own ViewChangeListener to the navigator and use it to block changing to a view based on whatever logic you have?