GUACAMOLE-394: Add history list at User object level (similar to Connection).

This commit is contained in:
Michael Jumper
2017-09-11 18:33:49 -07:00
parent 700005e823
commit b61f14e4db
5 changed files with 50 additions and 0 deletions

View File

@@ -19,6 +19,7 @@
package org.apache.guacamole.net.auth;
import java.util.List;
import java.util.Map;
import org.apache.guacamole.GuacamoleException;
import org.apache.guacamole.net.auth.permission.ObjectPermissionSet;
@@ -100,6 +101,23 @@ public interface User extends Identifiable {
*/
void setAttributes(Map<String, String> attributes);
/**
* Returns a list of ActivityRecords representing the login history
* of this user, including any active sessions. ActivityRecords
* in this list will be sorted in descending order of end time (active
* sessions are first), and then in descending order of start time
* (newer sessions are first).
*
* @return
* A list of ActivityRecords representing the login history of this
* User.
*
* @throws GuacamoleException
* If an error occurs while reading the history of this user, or if
* permission is denied.
*/
List<? extends ActivityRecord> getHistory() throws GuacamoleException;
/**
* Returns all system-level permissions given to this user.
*

View File

@@ -22,10 +22,12 @@ package org.apache.guacamole.net.auth.simple;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.apache.guacamole.GuacamoleException;
import org.apache.guacamole.net.auth.AbstractUser;
import org.apache.guacamole.net.auth.ActivityRecord;
import org.apache.guacamole.net.auth.permission.ObjectPermission;
import org.apache.guacamole.net.auth.permission.ObjectPermissionSet;
import org.apache.guacamole.net.auth.permission.SystemPermissionSet;
@@ -163,6 +165,11 @@ public class SimpleUser extends AbstractUser {
// Do nothing - there are no attributes
}
@Override
public List<ActivityRecord> getHistory() throws GuacamoleException {
return Collections.<ActivityRecord>emptyList();
}
@Override
public SystemPermissionSet getSystemPermissions()
throws GuacamoleException {