如何根据角色或权限在Jhipster中从Swagger文档中隐藏端点

时间:2020-05-18 10:41:02

标签: spring-boot swagger jhipster

generator-jhipster@6.8.0,整体版

在UserResource中,我尝试过:

    @PostMapping("/users")
    // @PreAuthorize("hasAuthority(\"" + AuthoritiesConstants.ADMIN + "\")")
    // @Secured({ AuthoritiesConstants.ADMIN })
    public ResponseEntity<User> createUser(@Valid @RequestBody UserDTO userDTO) throws URISyntaxException {
        log.debug("REST request to save User : {}", userDTO);

有帮助吗?

0 个答案:

没有答案