stataru8 commented on code in PR #1863:
URL: https://github.com/apache/karaf/pull/1863#discussion_r2070201105


##########
jaas/command/src/main/java/org/apache/karaf/jaas/command/ListUsersCommand.java:
##########
@@ -104,6 +105,8 @@ private List<String> displayGroupRoles(BackingEngine 
engine, String userName, Gr
                 names.add(roleName);
                 table.addRow().addContent(userName, group.getName(), roleName);
             }
+        } else {
+            table.addRow().addContent(userName, group.getName(), "");

Review Comment:
   I don't know if this proposal makes sense. I can revert.
   
   **Setup: user `foo` without any groups or roles declared.**
   
   Current behaviour
   ```
   karaf@trun()> jaas:group-add foo g1
   karaf@trun()> jaas:update
   karaf@trun()> jaas:realm-manage --realm karaf --module 
org.apache.karaf.jaas.modules.properties.PropertiesLoginModule
   karaf@trun()> jaas:user-list
   User Name │ Group      │ Role
   ──────────┼────────────┼──────────────
   foo       │            │
   ```
   
   Proposal
   ```
   karaf@trun()> jaas:group-add foo g1
   karaf@trun()> jaas:update
   karaf@trun()> jaas:realm-manage --realm karaf --module 
org.apache.karaf.jaas.modules.properties.PropertiesLoginModule
   karaf@trun()> jaas:user-list
   User Name │ Group      │ Role
   ──────────┼────────────┼──────────────
   foo       │ g1         │
   ```
   
   Proposal - more tests
   ```
   karaf@trun()> jaas:role-add foo r1
   karaf@trun()> jaas:update
   karaf@trun()> jaas:realm-manage --realm karaf --module 
org.apache.karaf.jaas.modules.properties.PropertiesLoginModule
   karaf@trun()> jaas:user-list
   User Name │ Group      │ Role
   ──────────┼────────────┼──────────────
   foo       │ g1         │
   foo       │            │ r1
   karaf@trun()> jaas:group-role-add g1 r1
   karaf@trun()> jaas:update
   karaf@trun()> jaas:realm-manage --realm karaf --module 
org.apache.karaf.jaas.modules.properties.PropertiesLoginModule
   karaf@trun()> jaas:user-list
   User Name │ Group      │ Role
   ──────────┼────────────┼──────────────
   foo       │ g1         │ r1
   ```
   



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

To unsubscribe, e-mail: [email protected]

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

Reply via email to