mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-07 05:31:22 +00:00
GUACAMOLE-1479: Implement the disabled methods in guacamole-ext User and UserGroup classes.
This commit is contained in:
@@ -78,6 +78,16 @@ public class DelegatingUser implements User {
|
||||
user.setPassword(password);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDisabled() {
|
||||
return user.isDisabled();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDisabled(boolean disabled) {
|
||||
user.setDisabled(disabled);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, String> getAttributes() {
|
||||
return user.getAttributes();
|
||||
|
@@ -66,6 +66,16 @@ public class DelegatingUserGroup implements UserGroup {
|
||||
userGroup.setIdentifier(identifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDisabled() {
|
||||
return userGroup.isDisabled();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDisabled(boolean disabled) {
|
||||
userGroup.setDisabled(disabled);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, String> getAttributes() {
|
||||
return userGroup.getAttributes();
|
||||
|
@@ -80,6 +80,23 @@ public interface User extends Identifiable, Attributes, Permissions {
|
||||
*/
|
||||
public void setPassword(String password);
|
||||
|
||||
/**
|
||||
* Returns true if this user account is disabled, otherwise false.
|
||||
*
|
||||
* @return
|
||||
* True if this user account is disabled, otherwise false.
|
||||
*/
|
||||
public boolean isDisabled();
|
||||
|
||||
/**
|
||||
* Set the disabled status of this account to the boolean parameter as
|
||||
* provided, true if the account should be disabled, otherwise false.
|
||||
*
|
||||
* @param disabled
|
||||
* True if the account should be disabled, otherwise false.
|
||||
*/
|
||||
public void setDisabled(boolean disabled);
|
||||
|
||||
/**
|
||||
* Returns the date and time that this user was last active. If the user
|
||||
* was never active, the time that the user was last active is unknown, or
|
||||
|
@@ -28,6 +28,25 @@ import org.apache.guacamole.GuacamoleException;
|
||||
*/
|
||||
public interface UserGroup extends Identifiable, Attributes, Permissions {
|
||||
|
||||
/**
|
||||
* Returns true if the user group is disabled, making membership in the group
|
||||
* ineffective, meaning that any permissions or other group membership
|
||||
* assigned to this group will not apply to member groups and users.
|
||||
*
|
||||
* @return
|
||||
* True if the group is disabled, otherwise false.
|
||||
*/
|
||||
public boolean isDisabled();
|
||||
|
||||
/**
|
||||
* Set the disabled status of the user group, passing a boolean true value
|
||||
* if the user group should be disabled, otherwise false.
|
||||
*
|
||||
* @param disabled
|
||||
* True if the user group should be disabled, otherwise false.
|
||||
*/
|
||||
public void setDisabled(boolean disabled);
|
||||
|
||||
/**
|
||||
* Returns a set of all readable user groups of which this user group is a
|
||||
* member. If permission is granted for the current user to modify the
|
||||
|
@@ -65,6 +65,28 @@ public class SimpleUser extends AbstractUser {
|
||||
super.setIdentifier(username);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>This User implementation is always enabled, so this method will
|
||||
* always return false.
|
||||
*/
|
||||
@Override
|
||||
public boolean isDisabled() {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>This User implementation is always enabled, so this method will
|
||||
* silently ignore the value passed in under the disabled parameter.
|
||||
*/
|
||||
@Override
|
||||
public void setDisabled(boolean disabled) {
|
||||
// Silently ignore disabled value
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a new READ permission to the given set of permissions for each of
|
||||
* the given identifiers.
|
||||
|
@@ -44,4 +44,26 @@ public class SimpleUserGroup extends AbstractUserGroup {
|
||||
super.setIdentifier(identifier);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>This implementation of UserGroup is always enabled, so this will
|
||||
* always return false.
|
||||
*/
|
||||
@Override
|
||||
public boolean isDisabled() {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>This implementation of UserGroup is always enabled, so this method
|
||||
* will silently ignore the value passed in the disabled parameter.
|
||||
*/
|
||||
@Override
|
||||
public void setDisabled(boolean disabled) {
|
||||
// Silently ignore as the UserGroup implementation is always enabled.
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user