azure-spring-boot/src/main/java/com/microsoft/azure/spring/autoconfigure/aad/AzureADGraphClient.java
public Set<GrantedAuthority> convertGroupsToGrantedAuthorities(final List<UserGroup> groups) {
        // Map the authority information to one or more GrantedAuthority's and add it to mappedAuthorities
        final Set<GrantedAuthority> mappedAuthorities = groups.stream().filter(this::isValidUserGroupToGrantAuthority)
                .map(userGroup -> new SimpleGrantedAuthority(DEFAULT_ROLE_PREFIX + userGroup.getDisplayName()))
                .collect(Collectors.toCollection(LinkedHashSet::new));
        if (mappedAuthorities.isEmpty()) {
            mappedAuthorities.add(DEFAULT_AUTHORITY);
        }

        return mappedAuthorities;
    }
public Set<GrantedAuthority> convertGroupsToGrantedAuthorities(final List<UserGroup> groups) {
        // Map the authority information to one or more GrantedAuthority's and add it to mappedAuthorities
        final Set<GrantedAuthority> mappedAuthorities = groups.stream().filter(this::isValidUserGroupToGrantAuthority)
                .map(userGroup -> new SimpleGrantedAuthority(DEFAULT_ROLE_PREFIX + userGroup.getDisplayName()))
                .collect(Collectors.toCollection(LinkedHashSet::new));
        if (mappedAuthorities.isEmpty()) {
            mappedAuthorities.add(DEFAULT_AUTHORITY);
        }

        return mappedAuthorities;
    }
public Set < GrantedAuthority > convertGroupsToGrantedAuthorities ( final List < UserGroup > groups ) { // Map the authority information to one or more GrantedAuthority's and add it to mappedAuthorities final Set < GrantedAuthority > mappedAuthorities = groups . stream ( ) . filter ( this :: isValidUserGroupToGrantAuthority ) . map ( userGroup -> new SimpleGrantedAuthority ( DEFAULT_ROLE_PREFIX + userGroup . getDisplayName ( ) ) ) . collect ( Collectors . toCollection ( LinkedHashSet :: new ) ) ; if ( mappedAuthorities . isEmpty ( ) ) { mappedAuthorities . add ( DEFAULT_AUTHORITY ) ; } return mappedAuthorities ; }
Converts UserGroup list to Set of GrantedAutorities
@param groups
@return
Converts UserGroup list to Set of GrantedAutorities