Spring security access with multiple roles

后端 未结 3 1107
说谎
说谎 2021-02-02 14:49

I want to define access for some pages for user who has one of following roles (ROLE1 or ROLE2)

I\'m trying to configure this in my spring security xml file as following

3条回答
  •  自闭症患者
    2021-02-02 15:15

    The problem was that I configured custom access-decision-manager-ref="accessDecisionManager" and didn't pass one of the voters.

    Solved by adding org.springframework.security.web.access.expression.WebExpressionVoter to accessDecisionManager bean.

提交回复
热议问题