springcloud-community / springcloud-comment

0 stars 0 forks source link

post/2022-02/easy-dyn-acl-spring-security/ #14

Open utterances-bot opened 1 year ago

utterances-bot commented 1 year ago

Spring Security Dynamic Permission Control could be a little simpler - Spring Cloud

Previously in the tutorial on dynamic permission control, we implemented dynamic permission control by customizing FilterInvocationSecurityMetadataSource and AccessDecisionManager two interfaces. There are more things we need to do here, and there is a certain learning cost. Today to introduce a more simple and easy to understand approach to implement dynamic permission control. Expression-based access control 1 2 3 httpSecurity.authorizeRequests() .anyRequest() .access("hasRole('admin')") Needless to say, after we configure the expression hasRole('admin'),

https://www.springcloud.io/post/2022-02/easy-dyn-acl-spring-security/

Lucasark commented 1 year ago

authorizeRequests deprecated and should use authorizeHttpRequests, but access do not recived any more string