Custom annotation with spring security

后端 未结 1 1289
孤独总比滥情好
孤独总比滥情好 2021-01-20 04:03

I have read spring security docs and learned that I can use the following annotation to check if the subject had access to edit user.

@PreAuthorize(\"hasPerm         


        
相关标签:
1条回答
  • 2021-01-20 04:08

    It is not a direct response to your question.

    As a workoround you can continue to use built-in annotations:

    @PreAuthorize("hasPermission('USER_MANAGEMENT_READ')")
    @PreAuthorize("hasPermission('USER_MANAGEMENT_CREATE')")
    @PreAuthorize("hasPermission('USER_MANAGEMENT_UPDATE')")
    @PreAuthorize("hasPermission('USER_MANAGEMENT_DELETE')")
    
    @PreAuthorize("hasPermission('ORDER_MANAGEMENT_READ')")
    @PreAuthorize("hasPermission('ORDER_MANAGEMENT_CREATE')")
    @PreAuthorize("hasPermission('ORDER_MANAGEMENT_UPDATE')")
    @PreAuthorize("hasPermission('ORDER_MANAGEMENT_DELETE')")
    
    0 讨论(0)
提交回复
热议问题