GUACAMOLE-78: Define a standard identifier for anonymous users.

This commit is contained in:
Michael Jumper
2016-08-12 12:51:53 -07:00
parent 8e283ef236
commit fcefa7a7c7
2 changed files with 19 additions and 0 deletions

View File

@@ -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.