mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 13:17:41 +00:00
GUACAMOLE-78: Define a standard identifier for anonymous users.
This commit is contained in:
@@ -28,6 +28,12 @@ package org.apache.guacamole.net.auth;
|
||||
*/
|
||||
public interface AuthenticatedUser extends Identifiable {
|
||||
|
||||
/**
|
||||
* The identifier reserved for representing a user that has authenticated
|
||||
* anonymously.
|
||||
*/
|
||||
public static final String ANONYMOUS_IDENTIFIER = "";
|
||||
|
||||
/**
|
||||
* Returns the AuthenticationProvider that authenticated this user.
|
||||
*
|
||||
|
@@ -256,6 +256,19 @@ angular.module('auth').factory('authenticationService', ['$injector',
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns whether the current user has authenticated anonymously. An
|
||||
* anonymous user is denoted by the identifier reserved by the Guacamole
|
||||
* extension API for anonymous users (the empty string).
|
||||
*
|
||||
* @returns {Boolean}
|
||||
* true if the current user has authenticated anonymously, false
|
||||
* otherwise.
|
||||
*/
|
||||
service.isAnonymous = function isAnonymous() {
|
||||
return service.getCurrentUsername() === '';
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns the username of the current user. If the current user is not
|
||||
* logged in, this value may not be valid.
|
||||
|
Reference in New Issue
Block a user