Github user necouchman commented on a diff in the pull request:
https://github.com/apache/guacamole-client/pull/301#discussion_r196265369
--- Diff:
guacamole/src/main/webapp/app/navigation/services/userPageService.js ---
@@ -257,15 +257,23 @@
angular.module('navigation').factory('userPageService', ['$injector',
canManageConnections.push(dataSource);
}
- // Determine whether the current user needs access to the
session management UI or view connection history
+ // Determine whether the current user needs access to view
connection history
if (
- // A user must be a system administrator to manage
sessions
+ // A user must be a system administrator to view
connection records
PermissionSet.hasSystemPermission(permissions,
PermissionSet.SystemPermissionType.ADMINISTER)
) {
- canManageSessions.push(dataSource);
canViewConnectionRecords.push(dataSource);
}
+ // Determine whether the current user needs access to view
session management
+ if (
+ // Permission to manage active sessions.
+ PermissionSet.hasSystemPermission(permissions,
PermissionSet.SystemPermissionType.ADMINISTER)
+ ||
PermissionSet.hasActiveConnectionPermission(permissions,
PermissionSet.ObjectPermissionType.DELETE)
--- End diff --
Always displaying it is fine with me. I actually originally implemented it
that way, but swapped over to checking for active connections and permissions.
The only side-effect that I see to this is dealing with the issue of
behavior when only a single connection is present and going to the home screen
vs. automatically connecting. In general, this wouldn't be an issue - we can
adjust the number of pages it looks at up one since we're adding one more that
is there for every user - however, there's a corner-case, here, that should at
least be considered, even if we ignore it.
Say the user only has access to a single connection, and that connection is
open on another system. The user wants to log in and kill that session, but
when they log in they get put into the connection automatically, disconnecting
the one on the other client, which starts the loop of connect/disconnect
between clients.
Again, it's a corner-case, but worth at least figuring out what we want to
do overall with automatic connections, whether this tab is always displayed,
etc.
---