GUAC-1100: Fix comments in User. ObjectPermissionSet does not need ObjectType parameter.

This commit is contained in:
Michael Jumper
2015-02-11 12:27:10 -08:00
parent cf36e5841a
commit a22299466b
4 changed files with 41 additions and 40 deletions

View File

@@ -69,47 +69,56 @@ public interface User {
public void setPassword(String password); public void setPassword(String password);
/** /**
* Lists all permissions given to this user. * Returns all system-level permissions given to this user.
* *
* @return A Set of all permissions granted to this user. * @return
* A SystemPermissionSet of all system-level permissions granted to
* this user.
* *
* @throws GuacamoleException If an error occurs while retrieving * @throws GuacamoleException
* permissions, or if reading all permissions * If an error occurs while retrieving permissions, or if reading all
* is not allowed. * permissions is not allowed.
*/ */
SystemPermissionSet getSystemPermissions() throws GuacamoleException; SystemPermissionSet getSystemPermissions() throws GuacamoleException;
/** /**
* Lists all permissions given to this user. * Returns all connection permissions given to this user.
* *
* @return A Set of all permissions granted to this user. * @return
* An ObjectPermissionSet of all connection permissions granted to this
* user.
* *
* @throws GuacamoleException If an error occurs while retrieving * @throws GuacamoleException
* permissions, or if reading all permissions * If an error occurs while retrieving permissions, or if reading all
* is not allowed. * permissions is not allowed.
*/ */
ObjectPermissionSet<String, Connection> getConnectionPermissions() throws GuacamoleException; ObjectPermissionSet<String> getConnectionPermissions()
throws GuacamoleException;
/** /**
* Lists all permissions given to this user. * Returns all connection group permissions given to this user.
* *
* @return A Set of all permissions granted to this user. * @return
* An ObjectPermissionSet of all connection group permissions granted
* to this user.
* *
* @throws GuacamoleException If an error occurs while retrieving * @throws GuacamoleException
* permissions, or if reading all permissions * If an error occurs while retrieving permissions, or if reading all
* is not allowed. * permissions is not allowed.
*/ */
ObjectPermissionSet<String, ConnectionGroup> getConnectionGroupPermissions() throws GuacamoleException; ObjectPermissionSet<String> getConnectionGroupPermissions()
throws GuacamoleException;
/** /**
* Lists all permissions given to this user. * Returns all user permissions given to this user.
* *
* @return A Set of all permissions granted to this user. * @return
* An ObjectPermissionSet of all user permissions granted to this user.
* *
* @throws GuacamoleException If an error occurs while retrieving * @throws GuacamoleException
* permissions, or if reading all permissions * If an error occurs while retrieving permissions, or if reading all
* is not allowed. * permissions is not allowed.
*/ */
ObjectPermissionSet<String, User> getUserPermissions() throws GuacamoleException; ObjectPermissionSet<String> getUserPermissions() throws GuacamoleException;
} }

View File

@@ -34,12 +34,8 @@ import org.glyptodon.guacamole.GuacamoleException;
* @param <IdentifierType> * @param <IdentifierType>
* The type of identifier used to identify objects affected by permissions * The type of identifier used to identify objects affected by permissions
* stored in this ObjectPermissionSet. * stored in this ObjectPermissionSet.
*
* @param <ObjectType>
* The type of objects affected by permissions stored in this
* ObjectPermissionSet.
*/ */
public interface ObjectPermissionSet<IdentifierType, ObjectType> { public interface ObjectPermissionSet<IdentifierType> {
/** /**
* Tests whether the permission of the given type is granted for the * Tests whether the permission of the given type is granted for the

View File

@@ -39,13 +39,9 @@ import org.glyptodon.guacamole.net.auth.permission.ObjectPermissionSet;
* @param <IdentifierType> * @param <IdentifierType>
* The type of identifier used to identify objects affected by permissions * The type of identifier used to identify objects affected by permissions
* stored in this SimpleObjectPermissionSet. * stored in this SimpleObjectPermissionSet.
*
* @param <ObjectType>
* The type of objects affected by permissions stored in this
* SimpleObjectPermissionSet.
*/ */
public class SimpleObjectPermissionSet<IdentifierType, ObjectType> public class SimpleObjectPermissionSet<IdentifierType>
implements ObjectPermissionSet<IdentifierType, ObjectType> { implements ObjectPermissionSet<IdentifierType> {
/** /**
* The set of all permissions currently granted. * The set of all permissions currently granted.

View File

@@ -112,21 +112,21 @@ public class SimpleUser extends AbstractUser {
} }
@Override @Override
public ObjectPermissionSet<String, Connection> getConnectionPermissions() public ObjectPermissionSet<String> getConnectionPermissions()
throws GuacamoleException { throws GuacamoleException {
return new SimpleObjectPermissionSet<String, Connection>(connectionPermissions); return new SimpleObjectPermissionSet<String>(connectionPermissions);
} }
@Override @Override
public ObjectPermissionSet<String, ConnectionGroup> getConnectionGroupPermissions() public ObjectPermissionSet<String> getConnectionGroupPermissions()
throws GuacamoleException { throws GuacamoleException {
return new SimpleObjectPermissionSet<String, ConnectionGroup>(connectionGroupPermissions); return new SimpleObjectPermissionSet<String>(connectionGroupPermissions);
} }
@Override @Override
public ObjectPermissionSet<String, User> getUserPermissions() public ObjectPermissionSet<String> getUserPermissions()
throws GuacamoleException { throws GuacamoleException {
return new SimpleObjectPermissionSet<String, User>(); return new SimpleObjectPermissionSet<String>();
} }
} }