Interface UiComponentPolicyApplier
- All Known Implementing Classes:
DefaultUiComponentPolicyApplier
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidapplyUiComponentPolicies(com.vaadin.flow.component.Component component) Applies UI component policies assigned to the current user to the given component and its children.voidapplyUiComponentPolicies(View<?> view) Applies UI component policies assigned to the current user to the given view.default voidapplyUiComponentPolicies(View<?> view, com.vaadin.flow.component.Component component) Applies UI component policies assigned to the current user to the given component and its children within the given view.
-
Method Details
-
applyUiComponentPolicies
Applies UI component policies assigned to the current user to the given view.- Parameters:
view- view the view to which the security policies should be applied
-
applyUiComponentPolicies
default void applyUiComponentPolicies(com.vaadin.flow.component.Component component) Applies UI component policies assigned to the current user to the given component and its children. Intended for content created after the view has been opened, for example the content of a lazy tab or components added programmatically.The component must be reachable from its view through the component tree: the policies address components by a path relative to the view, so an owner has to be found for it. Nothing is applied otherwise.
The content of a tab is the notable exception, because a
JmixTabSheetkeeps only the content of the selected tab in the tree, and attaches even that before the client response rather than when it is added. UseapplyUiComponentPolicies(View, Component)for content installed into a tab.- Parameters:
component- the component to apply the policies to
-
applyUiComponentPolicies
Applies UI component policies assigned to the current user to the given component and its children within the given view.Unlike
applyUiComponentPolicies(Component), the component does not have to be reachable from the view through the component tree. That matters for the content of a tab: aJmixTabSheetkeeps only the content of the selected tab in the tree, so content installed into a tab that is not open can only be handed over this way. The default implementation applies the policies to the whole view, which is correct but wider than asked: an implementation that supports subtrees is expected to override it.- Parameters:
view- the view the component belongs tocomponent- the component to apply the policies to
-