GUACAMOLE-78: Define a standard identifier for anonymous users.
This commit is contained in:
1 parent
8e283ef236
commit
fcefa7a7c7
2 files changed
+19
No files matched your search
@@ -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