Make class final

This commit is contained in:
Mario Petrovski 2023-09-01 14:32:33 +02:00 committed by Josh Cummings
parent 141605cb24
commit 19ae3a765d
1 changed files with 2 additions and 4 deletions

View File

@ -23,7 +23,7 @@ import org.springframework.security.authorization.AuthorityAuthorizationManager;
/** /**
* @author Mario Petrovski * @author Mario Petrovski
*/ */
public class ScopeAuthorizationManagerFactory { public final class ScopeAuthorizationManagerFactory {
private ScopeAuthorizationManagerFactory() { private ScopeAuthorizationManagerFactory() {
} }
@ -33,9 +33,7 @@ public class ScopeAuthorizationManagerFactory {
} }
public static <T> AuthorityAuthorizationManager<T> hasAnyScope(String... scopes) { public static <T> AuthorityAuthorizationManager<T> hasAnyScope(String... scopes) {
String[] mappedScopes = Arrays.stream(scopes).map(s -> { String[] mappedScopes = Arrays.stream(scopes).map(s -> "SCOPE_" + s).toArray(String[]::new);
return "SCOPE_" + s;
}).toArray(String[]::new);
return AuthorityAuthorizationManager.hasAnyAuthority(mappedScopes); return AuthorityAuthorizationManager.hasAnyAuthority(mappedScopes);
} }
} }