mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 05:07:41 +00:00
GUACAMOLE-926: Allow JDBC extensions to accept identifiers from user for update.
This commit is contained in:
@@ -534,6 +534,22 @@ public abstract class DirectoryResource<InternalType extends Identifiable, Exter
|
||||
|
||||
try {
|
||||
|
||||
// Set the model to the supplied identifier from the PATH
|
||||
String identifier = path.substring(1);
|
||||
|
||||
if (identifier == null)
|
||||
throw new GuacamoleClientException(
|
||||
"An identifier is required when updating.");
|
||||
|
||||
// If there's an identiifer provided in the value,
|
||||
// make sure it matches the one from the path
|
||||
String valueId = internal.getIdentifier();
|
||||
if (valueId != null && !valueId.equals(identifier))
|
||||
throw new GuacamoleClientException(
|
||||
"Identifier mismatch between path and value.");
|
||||
|
||||
internal.setIdentifier(identifier);
|
||||
|
||||
// Attempt to update the object
|
||||
directory.update(internal);
|
||||
|
||||
|
Reference in New Issue
Block a user