Package org.springframework.security.authorization.method

# Class MethodExpressionAuthorizationManager

java.lang.Object
org.springframework.security.authorization.method.MethodExpressionAuthorizationManager

All Implemented Interfaces:
  `AuthorizationManager<org.aopalliance.intercept.MethodInvocation>`

public final class MethodExpressionAuthorizationManager extends Object implements AuthorizationManager<org.aopalliance.intercept.MethodInvocation>
An expression-based `AuthorizationManager` that determines the access by evaluating the provided expression against the `MethodInvocation`.

Since:
  5.8

## Constructor Summary

Constructors
Constructor
Description
`MethodExpressionAuthorizationManager(String expressionString)`
Creates an instance.

## Method Summary

Modifier and Type
Method
Description
`AuthorizationDecision`
`check(Supplier<Authentication> authentication, org.aopalliance.intercept.MethodInvocation context)`
Determines the access by evaluating the provided expression.
`void`
`setExpressionHandler(SecurityExpressionHandler<org.aopalliance.intercept.MethodInvocation> expressionHandler)`
Sets the `SecurityExpressionHandler` to be used.
`String`
`toString()`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Methods inherited from interface org.springframework.security.authorization.AuthorizationManager

`authorize, verify`

## Constructor Details

### MethodExpressionAuthorizationManager

public MethodExpressionAuthorizationManager(String expressionString)
Creates an instance.

Parameters:
  `expressionString` - the raw expression string to parse

## Method Details

### setExpressionHandler

public void setExpressionHandler(SecurityExpressionHandler<org.aopalliance.intercept.MethodInvocation> expressionHandler)
Sets the `SecurityExpressionHandler` to be used. The default is `DefaultMethodSecurityExpressionHandler`.

Parameters:
  `expressionHandler` - the `SecurityExpressionHandler` to use

### check

public AuthorizationDecision check(Supplier<Authentication> authentication, org.aopalliance.intercept.MethodInvocation context)
Determines the access by evaluating the provided expression.

Specified by:
  `check` in interface `AuthorizationManager<org.aopalliance.intercept.MethodInvocation>`
Parameters:
  `authentication` - the `Supplier` of the `Authentication` to check
  `context` - the `MethodInvocation` to check
Returns:
  an `ExpressionAuthorizationDecision` based on the evaluated expression

### toString

public String toString()

Overrides:
  `toString` in class `Object`