concept restriction in category spring

appears as: restrictions, restrictions, The restrictions, restriction
Spring Security in Action

This is an excerpt from Manning's book Spring Security in Action.

In an application, you’ll often find the need to implement authorization in different scenarios. Consider another situation: most applications have restrictions regarding who should the user be to access certain functionality. Achieving this implies first the need to identify who creates an access request for a specific feature - authentication. As well, we need to know their privileges to allow them to use that part of the system. As the system becomes more complex, you’ll find different situations that require a specific implementation related to authentication and authorization.

  • mvcMatchers(HttpMethod method, String… patterns), which allows you to specify both the HTTP method to which the restrictions will apply and the paths. This method is useful if you want to apply different restrictions for different HTTP methods for the same path.
  • mvcMatchers(String… patterns), which is simpler and easier to use if you only need to apply the authorization restrictions based on paths. The restrictions will automatically apply for any HTTP method used with that path.