There is a request to the address. It is necessary, depending on the rights of the user, to perform different methods.
@RequestMapping(value = "/currentAsset",method = RequestMethod.GET) @PreAuthorize("hasAuthority('MANAGER')") public Map<String, List> currentAssetManager(Model model){ Map<String, List> stringListMap = new HashMap<>(); //logic return stringListMap; } @RequestMapping(value = "/currentAsset",method = RequestMethod.GET) @PreAuthorize("hasAuthority('BOSS')") public Map<String, List> currentAsset(Model model){ Map<String, List> stringListMap = new HashMap<>(); //logic return stringListMap; }
This option does not work, what a similar solution is Spring 3.0