Class SecurityConfig
java.lang.Object
uk.ac.manchester.spinnaker.alloc.security.SecurityConfig
@EnableWebSecurity
@Role(0)
@EnableMethodSecurity(prePostEnabled=true)
public class SecurityConfig
extends Object
The security and administration configuration of the service.
 
 Note: role expressions (IS_USER and
 IS_ADMIN) must be applied (with @PreAuthorize) to
 interfaces of classes (or methods of those interfaces) that are
 Spring Beans in order for the security interception to be applied correctly.
 This is the only combination that is known to work reliably.
- Author:
- Donal Fellows
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final StringHow to assert that a user must be an admin.static final StringHow to assert that a user must be an admin.static final StringHow to assert that a user must be able to read summaries.static final StringHow to assert that a user must be able to make jobs and read job details in depth.static final StringHow to filter out job details that a given user may see (or not).
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidConfigure things we plug into.securityFilter(HttpSecurity http, HandlerMappingIntrospector introspector) Define our main security controls.
- 
Field Details- 
IS_ADMINHow to assert that a user must be an admin.- See Also:
 
- 
IS_NMPI_EXECHow to assert that a user must be an admin.- See Also:
 
- 
IS_READERHow to assert that a user must be able to read summaries.- See Also:
 
- 
MAY_SEE_JOB_DETAILSHow to filter out job details that a given user may see (or not).- See Also:
 
- 
IS_USERHow to assert that a user must be able to make jobs and read job details in depth.- See Also:
 
 
- 
- 
Constructor Details- 
SecurityConfigpublic SecurityConfig()
 
- 
- 
Method Details- 
configureGlobalConfigure things we plug into.- Parameters:
- auth- The authentication manager builder to configure.
 
- 
securityFilter@Bean @Role(1) public SecurityFilterChain securityFilter(HttpSecurity http, HandlerMappingIntrospector introspector) throws Exception Define our main security controls.- Parameters:
- http- Used to build the filter chain.
- introspector- The introspector used to build request matchers.
- Returns:
- The filter chain that implements the controls.
- Throws:
- Exception- If anything goes wrong with setting up. Not expected.
 
 
-