private GuacamoleConfiguration getConnectionConfiguration(Connection connection)
            throws GuacamoleException {

        String identifier = connection.getIdentifier();

        // Obtain privileged access to parameters if possible (note that the
        // UserContext returned by getPrivileged() is not guaranteed to
        // actually be privileged)
        Connection privilegedConnection = getPrivileged().getConnectionDirectory().get(identifier);
        if (privilegedConnection != null)
            return privilegedConnection.getConfiguration();

        // Fall back to unprivileged access if not implemented/allowed by
        // extension
        return connection.getConfiguration();

    }
Retrieves the GuacamoleConfiguration of the given Connection. If
possible, privileged access to the configuration is obtained first. Note
that the underlying extension is not required to allow privileged
access, nor is it required to expose the underlying configuration at
all.

@param connection
    The connection to retrieve the configuration from.

@return
    The GuacamoleConfiguration associated with the given connection,
    which may be partial or empty.

@throws GuacamoleException
    If an error prevents privileged retrieval of the configuration.
extensions/guacamole-vault/modules/guacamole-vault-base/src/main/java/org/apache/guacamole/vault/user/VaultUserContext.java