Skip to content

Commit 2b47944

Browse files
evgeniychebanSteve Riesenberg
authored and
Steve Riesenberg
committed
Polish gh-11188
1 parent f34ea18 commit 2b47944

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

core/src/main/java/org/springframework/security/authorization/AuthorityAuthorizationManager.java

+1-10
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
package org.springframework.security.authorization;
1818

19-
import java.util.HashSet;
2019
import java.util.List;
2120
import java.util.Set;
2221
import java.util.function.Supplier;
@@ -133,7 +132,7 @@ private boolean isGranted(Authentication authentication) {
133132
}
134133

135134
private boolean isAuthorized(Authentication authentication) {
136-
Set<String> authorities = getAuthoritySet();
135+
Set<String> authorities = AuthorityUtils.authorityListToSet(this.authorities);
137136
for (GrantedAuthority grantedAuthority : authentication.getAuthorities()) {
138137
if (authorities.contains(grantedAuthority.getAuthority())) {
139138
return true;
@@ -142,14 +141,6 @@ private boolean isAuthorized(Authentication authentication) {
142141
return false;
143142
}
144143

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-
153144
@Override
154145
public String toString() {
155146
return "AuthorityAuthorizationManager[authorities=" + this.authorities + "]";

0 commit comments

Comments
 (0)