File tree 1 file changed +1
-10
lines changed
core/src/main/java/org/springframework/security/authorization
1 file changed +1
-10
lines changed Original file line number Diff line number Diff line change 16
16
17
17
package org .springframework .security .authorization ;
18
18
19
- import java .util .HashSet ;
20
19
import java .util .List ;
21
20
import java .util .Set ;
22
21
import java .util .function .Supplier ;
@@ -133,7 +132,7 @@ private boolean isGranted(Authentication authentication) {
133
132
}
134
133
135
134
private boolean isAuthorized (Authentication authentication ) {
136
- Set <String > authorities = getAuthoritySet ( );
135
+ Set <String > authorities = AuthorityUtils . authorityListToSet ( this . authorities );
137
136
for (GrantedAuthority grantedAuthority : authentication .getAuthorities ()) {
138
137
if (authorities .contains (grantedAuthority .getAuthority ())) {
139
138
return true ;
@@ -142,14 +141,6 @@ private boolean isAuthorized(Authentication authentication) {
142
141
return false ;
143
142
}
144
143
145
- private Set <String > getAuthoritySet () {
146
- Set <String > result = new HashSet <>();
147
- for (GrantedAuthority grantedAuthority : this .authorities ) {
148
- result .add (grantedAuthority .getAuthority ());
149
- }
150
- return result ;
151
- }
152
-
153
144
@ Override
154
145
public String toString () {
155
146
return "AuthorityAuthorizationManager[authorities=" + this .authorities + "]" ;
You can’t perform that action at this time.
0 commit comments