/spring-boot-security-custompermissions

Demo project for Spring Boot with custom permissions

Primary LanguageJava

Example of using country specific permissions with Spring Boot

This repository contains a Spring Boot example of using country specific permissions.

The main magic happens in the custom PermissionEvalusator.

Here we try to evaluate the input arguments given in the secured controller. @PreAuthorize("hasPermission(#countryCode, 'MY_ROLE')")

With this configuration we configure spring to use our custom evaluator.

Please also check the related tests to find out how it works.