mirror of
				https://github.com/gyurix1968/guacamole-client.git
				synced 2025-10-31 17:13:21 +00:00 
			
		
		
		
	GUACAMOLE-394: Add history list at User object level (similar to Connection).
This commit is contained in:
		| @@ -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. | ||||
|      * | ||||
|   | ||||
| @@ -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 { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user