diff --git a/guacamole-ext/src/main/java/net/sourceforge/guacamole/net/auth/permission/GuacamoleConfigurationPermission.java b/guacamole-ext/src/main/java/net/sourceforge/guacamole/net/auth/permission/GuacamoleConfigurationPermission.java index 6e2838aee..abaacebce 100644 --- a/guacamole-ext/src/main/java/net/sourceforge/guacamole/net/auth/permission/GuacamoleConfigurationPermission.java +++ b/guacamole-ext/src/main/java/net/sourceforge/guacamole/net/auth/permission/GuacamoleConfigurationPermission.java @@ -53,7 +53,7 @@ public class GuacamoleConfigurationPermission * The identifier of the GuacamoleConfiguration associated with the * operation affected by this permission. */ - private String subject; + private String identifier; /** * The type of operation affected by this permission. @@ -62,22 +62,23 @@ public class GuacamoleConfigurationPermission /** * Creates a new GuacamoleConfigurationPermission having the given type - * and subject. + * and identifier. The identifier must be the unique identifier assigned + * to the GuacamoleConfiguration by the AuthenticationProvider in use. * * @param type The type of operation affected by this permission. - * @param subject The identifier of the GuacamoleConfiguration associated - * with the operation affected by this permission. + * @param identifier The identifier of the GuacamoleConfiguration associated + * with the operation affected by this permission. */ - public GuacamoleConfigurationPermission(Type type, String subject) { + public GuacamoleConfigurationPermission(Type type, String identifier) { - this.subject = subject; + this.identifier = identifier; this.type = type; } @Override - public String getSubject() { - return subject; + public String getObjectIdentifier() { + return identifier; } @Override diff --git a/guacamole-ext/src/main/java/net/sourceforge/guacamole/net/auth/permission/ObjectPermission.java b/guacamole-ext/src/main/java/net/sourceforge/guacamole/net/auth/permission/ObjectPermission.java index a67b7516a..9541e5c50 100644 --- a/guacamole-ext/src/main/java/net/sourceforge/guacamole/net/auth/permission/ObjectPermission.java +++ b/guacamole-ext/src/main/java/net/sourceforge/guacamole/net/auth/permission/ObjectPermission.java @@ -43,7 +43,7 @@ package net.sourceforge.guacamole.net.auth.permission; * whole. * * @author Michael Jumper - * @param The type of object this permission affects. + * @param The type of identifier used by the object this permission affects. */ public interface ObjectPermission extends Permission { @@ -76,9 +76,12 @@ public interface ObjectPermission extends Permission { } /** - * Returns the specific object affected by this permission. - * @return The specific object affected by this permission. + * Returns the identifier of the specific object affected by this + * permission. + * + * @return The identifier of the specific object affected by this + * permission. */ - public T getSubject(); + public T getObjectIdentifier(); } diff --git a/guacamole-ext/src/main/java/net/sourceforge/guacamole/net/auth/permission/UserPermission.java b/guacamole-ext/src/main/java/net/sourceforge/guacamole/net/auth/permission/UserPermission.java index 965e56abb..f8c33903c 100644 --- a/guacamole-ext/src/main/java/net/sourceforge/guacamole/net/auth/permission/UserPermission.java +++ b/guacamole-ext/src/main/java/net/sourceforge/guacamole/net/auth/permission/UserPermission.java @@ -37,8 +37,6 @@ package net.sourceforge.guacamole.net.auth.permission; * * ***** END LICENSE BLOCK ***** */ -import net.sourceforge.guacamole.net.auth.User; - /** * A permission which controls operations that directly affect a specific @@ -52,7 +50,7 @@ public class UserPermission implements ObjectPermission { * The username of the User associated with the operation affected by this * permission. */ - private String subject; + private String identifier; /** * The type of operation affected by this permission. @@ -60,22 +58,23 @@ public class UserPermission implements ObjectPermission { private Type type; /** - * Creates a new UserPermission having the given type and subject. + * Creates a new UserPermission having the given type and identifier. The + * identifier must be the user's username. * * @param type The type of operation affected by this permission. - * @param subject The username of the User associated with the operation - * affected by this permission. + * @param identifier The username of the User associated with the operation + * affected by this permission. */ - public UserPermission(String subject, Type type) { + public UserPermission(String identifier, Type type) { - this.subject = subject; + this.identifier = identifier; this.type = type; } @Override - public String getSubject() { - return subject; + public String getObjectIdentifier() { + return identifier; } @Override