necouchman commented on a change in pull request #389:
URL: https://github.com/apache/guacamole-client/pull/389#discussion_r443125931



##########
File path: 
extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/base/ModeledDirectoryObjectService.java
##########
@@ -429,14 +429,19 @@ public InternalType 
retrieveObject(ModeledAuthenticatedUser user,
         
         // Build list of implicit permissions
         Collection<ObjectPermissionModel> implicitPermissions =
-                new 
ArrayList<ObjectPermissionModel>(IMPLICIT_OBJECT_PERMISSIONS.length);
+                new ArrayList<>();
 
         UserModel userModel = user.getUser().getModel();
         for (ObjectPermission.Type permission : IMPLICIT_OBJECT_PERMISSIONS) {
 
+            Integer entityId = userModel.getEntityID();
+            
+            if (entityId == null)
+                continue;

Review comment:
       As far as I know, the only circumstances where `entityId` is null is 
where the system user is doing the work rather than an actual user.  That said, 
it should always be null, so I can definitely re-arrange this a bit.  I just 
wasn't sure where the permission comes from that grants the new entity `READ` 
access to itself...




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to