Class CurrentUserUiComponentPoliciesImpl
java.lang.Object
io.jmix.uiconstraints.security.impl.CurrentUserUiComponentPoliciesImpl
- All Implemented Interfaces:
CurrentUserUiComponentPolicies
@Component("uicns_CurrentUserUiComponentPolicies")
@SessionScope
public class CurrentUserUiComponentPoliciesImpl
extends Object
implements CurrentUserUiComponentPolicies
The default implementation of the
CurrentUserUiComponentPolicies
interface. This bean has a "session" scope.
It caches the effective UI component policies for the current user.-
Constructor Summary
ConstructorDescriptionCurrentUserUiComponentPoliciesImpl
(CurrentUserRolesProvider currentUserRolesProvider, UiConstraintsProperties uiConstraintsProperties, CurrentUserSubstitution currentUserSubstitution) -
Method Summary
Modifier and TypeMethodDescriptionReturns effective UI component policies for the current user for the given view.void
Invalidates the cache of effective UI component policies.
-
Constructor Details
-
CurrentUserUiComponentPoliciesImpl
public CurrentUserUiComponentPoliciesImpl(CurrentUserRolesProvider currentUserRolesProvider, UiConstraintsProperties uiConstraintsProperties, CurrentUserSubstitution currentUserSubstitution)
-
-
Method Details
-
getEffectiveUiComponentPoliciesForView
Description copied from interface:CurrentUserUiComponentPolicies
Returns effective UI component policies for the current user for the given view.This method retrieves the resource roles for the current user, constructs a map of component IDs to their corresponding resource policies, and evaluates the effective policies for each component.
- Specified by:
getEffectiveUiComponentPoliciesForView
in interfaceCurrentUserUiComponentPolicies
- Parameters:
viewId
- the ID of the view for which the policies are being retrieved- Returns:
- a map where the key is the component ID and the value is a list of effective resource policies for that component
-
invalidateCache
public void invalidateCache()Description copied from interface:CurrentUserUiComponentPolicies
Invalidates the cache of effective UI component policies.- Specified by:
invalidateCache
in interfaceCurrentUserUiComponentPolicies
-