authorize

fun authorize(matches: RequestMatcher = AnyRequestMatcher.INSTANCE, access: AuthorizationManager<in RequestAuthorizationContext>)

Adds a request authorization rule.

Parameters

matches

the RequestMatcher to match incoming requests against

access

the AuthorizationManager to secure the matching request (i.e. created via hasAuthority("ROLE_USER"))


fun authorize(pattern: String, access: AuthorizationManager<in RequestAuthorizationContext>)

Adds a request authorization rule for an endpoint matching the provided pattern. If Spring MVC is on the classpath, it will use an MVC matcher. If Spring MVC is not on the classpath, it will use an ant matcher. The MVC will use the same rules that Spring MVC uses for matching. For example, often times a mapping of the path "/path" will match on "/path", "/path/", "/path.html", etc. If the current request will not be processed by Spring MVC, a reasonable default using the pattern as an ant pattern will be used.

Parameters

pattern

the pattern to match incoming requests against.

access

the AuthorizationManager to secure the matching request (i.e. created via hasAuthority("ROLE_USER"))


fun authorize(method: HttpMethod, pattern: String, access: AuthorizationManager<in RequestAuthorizationContext>)

Adds a request authorization rule for an endpoint matching the provided pattern. If Spring MVC is on the classpath, it will use an MVC matcher. If Spring MVC is not on the classpath, it will use an ant matcher. The MVC will use the same rules that Spring MVC uses for matching. For example, often times a mapping of the path "/path" will match on "/path", "/path/", "/path.html", etc. If the current request will not be processed by Spring MVC, a reasonable default using the pattern as an ant pattern will be used.

Parameters

method

the HTTP method to match the income requests against.

pattern

the pattern to match incoming requests against.

access

the AuthorizationManager to secure the matching request (i.e. created via hasAuthority("ROLE_USER"))


fun authorize(pattern: String, servletPath: String, access: AuthorizationManager<in RequestAuthorizationContext>)

Adds a request authorization rule for an endpoint matching the provided pattern. If Spring MVC is on the classpath, it will use an MVC matcher. If Spring MVC is not on the classpath, it will use an ant matcher. The MVC will use the same rules that Spring MVC uses for matching. For example, often times a mapping of the path "/path" will match on "/path", "/path/", "/path.html", etc. If the current request will not be processed by Spring MVC, a reasonable default using the pattern as an ant pattern will be used.

Parameters

pattern

the pattern to match incoming requests against.

servletPath

the servlet path to match incoming requests against. This only applies when using an MVC pattern matcher.

access

the AuthorizationManager to secure the matching request (i.e. created via hasAuthority("ROLE_USER"))


fun authorize(method: HttpMethod, pattern: String, servletPath: String, access: AuthorizationManager<in RequestAuthorizationContext>)

Adds a request authorization rule for an endpoint matching the provided pattern. If Spring MVC is on the classpath, it will use an MVC matcher. If Spring MVC is not on the classpath, it will use an ant matcher. The MVC will use the same rules that Spring MVC uses for matching. For example, often times a mapping of the path "/path" will match on "/path", "/path/", "/path.html", etc. If the current request will not be processed by Spring MVC, a reasonable default using the pattern as an ant pattern will be used.

Parameters

method

the HTTP method to match the income requests against.

pattern

the pattern to match incoming requests against.

servletPath

the servlet path to match incoming requests against. This only applies when using an MVC pattern matcher.

access

the AuthorizationManager to secure the matching request (i.e. created via hasAuthority("ROLE_USER"))