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,io.micronaut.security.utils.SecurityService.class,SecurityViewModelProcessorConfiguration.class}) @Requires(classes=io.micronaut.http.HttpRequest.class)
@Singleton
public class SecurityViewModelProcessor
extends Object
implements ViewModelProcessor<Map<String,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, io.micronaut.security.utils.SecurityService securityService) -
Method Summary
Modifier and TypeMethodDescriptionvoid
process
(@NonNull io.micronaut.http.HttpRequest<?> request, @NonNull ModelAndView<Map<String, Object>> modelAndView) Invoked prior to the view rendering.
-
Constructor Details
-
SecurityViewModelProcessor
public SecurityViewModelProcessor(SecurityViewModelProcessorConfiguration securityViewModelProcessorConfiguration, io.micronaut.security.utils.SecurityService securityService) - Parameters:
securityViewModelProcessorConfiguration
- The Security Views Model Decorator configurationsecurityService
- Utility to access Security information
-
-
Method Details
-
process
public 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
-