static AccessPredicate hasAuthority(final GrantedAuthority role) {
        requireNonNull(role, "role");
        return (a, c) -> {
            for (final GrantedAuthority authority : a.getAuthorities()) {
                if (role.equals(authority)) {
                    return true;
                }
            }
            return false;
        };
    }
Only those who have the given {@link GrantedAuthority} can access the protected instance.

@param role The role to check for.
@return A newly created AccessPredicate that only returns true, if the {@link GrantedAuthority}s matches the
        given role.
grpc-server-spring-boot-starter/src/main/java/net/devh/boot/grpc/server/security/check/AccessPredicate.java