mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 13:17:41 +00:00
GUACAMOLE-38: Fix issues with root identifier and directory.
This commit is contained in:
@@ -36,11 +36,6 @@ import org.apache.guacamole.protocol.GuacamoleConfiguration;
|
||||
*/
|
||||
public class QuickConnectDirectory extends SimpleDirectory<Connection> {
|
||||
|
||||
/**
|
||||
* The unique identifier of the root connection group.
|
||||
*/
|
||||
private static final String ROOT_IDENTIFIER = "ROOT";
|
||||
|
||||
/**
|
||||
* The connections to store.
|
||||
*/
|
||||
@@ -113,7 +108,7 @@ public class QuickConnectDirectory extends SimpleDirectory<Connection> {
|
||||
|
||||
// Create a new connection and set the parent identifier.
|
||||
Connection connection = new SimpleConnection(name, connectionId, config);
|
||||
connection.setParentIdentifier(ROOT_IDENTIFIER);
|
||||
connection.setParentIdentifier(QuickConnectUserContext.ROOT_IDENTIFIER);
|
||||
|
||||
// Place the object in this directory.
|
||||
add(connection);
|
||||
|
@@ -37,6 +37,11 @@ import org.apache.guacamole.net.auth.simple.SimpleUser;
|
||||
*/
|
||||
public class QuickConnectUserContext extends AbstractUserContext {
|
||||
|
||||
/**
|
||||
* The unique identifier of the root connection group.
|
||||
*/
|
||||
public static final String ROOT_IDENTIFIER = DEFAULT_ROOT_CONNECTION_GROUP;
|
||||
|
||||
/**
|
||||
* The AuthenticationProvider that created this UserContext.
|
||||
*/
|
||||
@@ -71,25 +76,25 @@ public class QuickConnectUserContext extends AbstractUserContext {
|
||||
* The name of the user logging in and using this class.
|
||||
*/
|
||||
public QuickConnectUserContext(AuthenticationProvider authProvider,
|
||||
String username) {
|
||||
String username) throws GuacamoleException {
|
||||
|
||||
// Initialize the rootGroup to a basic connection group with a
|
||||
// single root identifier.
|
||||
this.rootGroup = new QuickConnectionGroup(
|
||||
DEFAULT_ROOT_CONNECTION_GROUP,
|
||||
DEFAULT_ROOT_CONNECTION_GROUP
|
||||
);
|
||||
|
||||
// Initialize the user to a SimpleUser with the provided username,
|
||||
// no connections, and the single root group.
|
||||
this.self = new SimpleUser(username,
|
||||
Collections.<String>emptyList(),
|
||||
Collections.singleton(DEFAULT_ROOT_CONNECTION_GROUP)
|
||||
ROOT_IDENTIFIER,
|
||||
ROOT_IDENTIFIER
|
||||
);
|
||||
|
||||
// Initialize the connection directory
|
||||
this.connectionDirectory = new QuickConnectDirectory(this.rootGroup);
|
||||
|
||||
// Initialize the user to a SimpleUser with the provided username,
|
||||
// no connections, and the single root group.
|
||||
this.self = new SimpleUser(username,
|
||||
connectionDirectory.getIdentifiers(),
|
||||
Collections.singleton(ROOT_IDENTIFIER)
|
||||
);
|
||||
|
||||
// Set the authProvider to the calling authProvider object.
|
||||
this.authProvider = authProvider;
|
||||
|
||||
|
Reference in New Issue
Block a user