我需要在 spring @PreAuthorize 注释中使用 && 运算符,如下所示:
@PreAuthorize("hasAuthority('AUTH_ADMIN') && isEnabled(principal.department, #docCat)")
@RequestMapping(value = "/samedept/patient/{pin}/results/{docCat}/{docResultType}/{docId}", method = RequestMethod.GET,
headers = ContentTypeHeader.HEADER_APPLICATION_PDF)
ModelAndView secureViewResultPdf(@PathVariable(value = "pin") long pin,
@PathVariable(value = "docCat") String docCat,
@PathVariable(value = "docResultType") String docResultType,
@PathVariable(value = "docId") String docId);
我试过了,但我得到了
java.lang.IllegalStateException: Cannot handle (38) '&'
at org.springframework.expression.spel.standard.Tokenizer.process(Tokenizer.java:193)
我浏览了整个网络,但找不到以这种方式使用 && 运算符的示例。是否可以?