Ignore:
Timestamp:
2021-08-12T19:34:43+12:00 (3 years ago)
Author:
anupama
Message:

Part 2 of commit on expanded user groups, related to prev commit (revision 35286) which was part 1. In this commit, I think I've identified the only times UserTermInfo.getExpandedGroups() needs to be called: when authentication-ping/ServletRealmCheck is called, which redirect to Authentication.processRemoteAuthentication(). At other times, the original group listing is what's required (for user listing display/modification in GS3 Reader Interface) or is sufficient (to check user is in admin group, the group listing in userDB/originally entered group listing is enough and no expanded list is needed. Maybe origGroups can better be renamed back to groups and getOrigGroups replaced with plain getGroups(), since getExpandedGroups() is the method called in more exceptional circumstances after all.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/Authentication.java

    r35286 r35287  
    163163  protected static final String COLLECTION = "collection";
    164164  protected static final String GROUPS = "groups";
     165  protected static final String EXPANDED_GROUPS = "expanded_groups";
    165166  protected static final String STATUS = "status";
    166167  protected static final String RECAPTCHA_KEY = "recaptcha_key";
     
    427428               
    428429                // gliserver.pl used to return the groups when authentication succeeded
    429                 String groups = retrieveDataForUser(username, GROUPS); //comma-separated list
     430                String groups = retrieveDataForUser(username, EXPANDED_GROUPS); //comma-separated list
    430431               
    431432                if(collection.equals("")) {
     
    12111212                    break;
    12121213                }
     1214                else if (dataType.equals(EXPANDED_GROUPS))
     1215                {
     1216                    data = ((UserTermInfo) userInfo.get(i)).getExpandedGroups();
     1217                    break;
     1218                }
    12131219                else if (dataType.equals(STATUS))
    12141220                {
     
    12471253            String username = ((UserTermInfo) userInfo.get(i)).getUsername();
    12481254            String groups = ((UserTermInfo) userInfo.get(i)).getOrigGroups();
     1255            // Retrieve original (stored, user-entered) and not expanded groups
     1256            // as getUserNodeList only used in addUserInformationToNode() which
     1257            // allows displaying and modifying user info pages
     1258            // and authenticating admin user which doesn't require expanded groups.
    12491259            String accountstatus = ((UserTermInfo) userInfo.get(i)).getAccountStatus();
    12501260            String comment = ((UserTermInfo) userInfo.get(i)).getComment();
Note: See TracChangeset for help on using the changeset viewer.