private void addConnectionDescendants ( Collection < Connection > connections , List < ObjectPermission . Type > permissions ) throws GuacamoleException { // If no connections, nothing to do if ( connections . isEmpty ( ) ) return ; // Build lists of sharing profile identifiers for retrieval Collection < String > identifiers = new ArrayList < String > ( ) ; for ( Connection connection : connections ) identifiers . addAll ( connection . getSharingProfileIdentifiers ( ) ) ; // Filter identifiers based on permissions, if requested if ( permissions != null && ! permissions . isEmpty ( ) ) identifiers = sharingProfilePermissions . getAccessibleObjects ( permissions , identifiers ) ; // Retrieve and add all associated sharing profiles if ( ! identifiers . isEmpty ( ) ) { Collection < SharingProfile > sharingProfiles = sharingProfileDirectory . getAll ( identifiers ) ; addSharingProfiles ( sharingProfiles ) ; } }
Adds all descendant sharing profiles of the given connections to their corresponding primary connections already stored under root .