this.userCache = userProvider;
}
@PostConstruct
public void init() {
StyleBindingsRegistry.get().addStyleBinding(this, RestrictedAccess.class, new AnnotationStyleBindingExecutor() {
@Override
public void invokeBinding(final Element element, final Annotation annotation) {
final User user = userCache.getUser();
if (User.ANONYMOUS.equals(userCache.getUser()) || !user.hasAllRoles(((RestrictedAccess) annotation).roles())) {
element.addClassName(RestrictedAccess.CSS_CLASS_NAME);