Class SecurityViewModelProcessor
java.lang.Object
io.micronaut.views.model.security.SecurityViewModelProcessor
- All Implemented Interfaces:
ViewModelProcessor<Map<String,
Object>>
@Requires(property="micronaut.security.views-model-decorator.enabled",notEquals="false") @Requires(beans={io.micronaut.security.filters.SecurityFilter.class,SecurityViewModelProcessorConfiguration.class}) @Requires(classes=io.micronaut.http.HttpRequest.class)
@Singleton
public non-sealed class SecurityViewModelProcessor
extends Object
Returns information about the current user so that it can be appended to the model being rendered.
- Since:
- 1.1.0
- Author:
- Sergio del Amo
-
Constructor Summary
ConstructorDescriptionSecurityViewModelProcessor
(SecurityViewModelProcessorConfiguration securityViewModelProcessorConfiguration) SecurityViewModelProcessor
(SecurityViewModelProcessorConfiguration securityViewModelProcessorConfiguration, io.micronaut.security.utils.SecurityService securityService) Deprecated, for removal: This API element is subject to removal in a future version. -
Method Summary
Modifier and TypeMethodDescriptionvoid
populateModel
(io.micronaut.http.HttpRequest<?> request, Map<String, Object> model) default void
process
(@NonNull io.micronaut.http.HttpRequest<?> request, @NonNull ModelAndView<Map<String, Object>> modelAndView) Invoked prior to the view rendering.
-
Constructor Details
-
SecurityViewModelProcessor
@Inject public SecurityViewModelProcessor(SecurityViewModelProcessorConfiguration securityViewModelProcessorConfiguration) - Parameters:
securityViewModelProcessorConfiguration
- The Security Views Model Decorator configuration
-
SecurityViewModelProcessor
@Deprecated(forRemoval=true, since="5.2.0") public SecurityViewModelProcessor(SecurityViewModelProcessorConfiguration securityViewModelProcessorConfiguration, io.micronaut.security.utils.SecurityService securityService) Deprecated, for removal: This API element is subject to removal in a future version.- Parameters:
securityViewModelProcessorConfiguration
- The Security Views Model Decorator configurationsecurityService
- Utility to access Security information
-
-
Method Details
-
populateModel
-
process
default void process(@NonNull @NonNull io.micronaut.http.HttpRequest<?> request, @NonNull @NonNull ModelAndView<Map<String, Object>> modelAndView) Description copied from interface:ViewModelProcessor
Invoked prior to the view rendering.- Specified by:
process
in interfaceViewModelProcessor<Map<String,
Object>> - Parameters:
request
- The request being processedmodelAndView
- The model and view
-
SecurityViewModelProcessor(SecurityViewModelProcessorConfiguration)
instead