課題 SpringSecurityのサンプルでは、以下のようにROLEに基づいて認可していることが多い。 @Override protected void configure(HttpSecurity httpSecurity) throws Exception { httpSecurity.authorizeRequests() .antMatchers("/admin/**").hasRole("ADMIN") が、ロールに基づいた認可ではなく権限に基づいた認可を行いたい。つまり、ロールごとに複数の権限を持たせ、ユーザにロールを複数割り当てたい。 参考 業務システムにおけるロールベースアクセス制御 解決方法 SpringSecurityでは、AuthenticationクラスをもとにアクセスコントロールするためのEL式が提供されている。 ログイン時にAuthenticationクラスの
![SpringSecurity 権限に基づいた認可をする - Qiita](https://cdn-ak-scissors.b.st-hatena.com/image/square/cbc1f0f7d57c0fbd7dc87d81bc07542c36a83eff/height=288;version=1;width=512/https%3A%2F%2Fcdn.qiita.com%2Fassets%2Fqiita-fb-2887e7b4aad86fd8c25cea84846f2236.png)