Kuali Rice Development
  1. Kuali Rice Development
  2. KULRICE-8684

ActionRequestValue is not handling missing Person or Group objects

    Details

    • Type: Bug Fix Bug Fix
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.1.2
    • Fix Version/s: 2.1.3
    • Component/s: Development
    • Security Level: Public (Public: Anyone can view)
    • Labels:
      None
    • Similar issues:
      KULRICE-4680KIM Type is not copied onto the person document version of the group object
      KULRICE-4442Person service does not handle extension objects properly
      KULRICE-11043Person document goes into exception when attempting to deactivate a Person with a single group membership
      KULRICE-4575IM Person doc should only allow editing of direct group memberships
      KULRICE-13014Create KRAD widget to handle read-only KIM inquiries
      KULRICE-4953KIM Person Document does not handle duplicate active group memberships correctly.
      KULRICE-4218Handle Groups and Roles without members
      KULRICE-9183Effective dating for 'group' objects
      KULRICE-3218Refactor encryption handling in KimEntityExternalIdentifierImpl
      KULRICE-4890Direct Inquiry on KIM Objects does not handle invalid inputs
    • KAI Review Status:
      Not Required
    • KTI Review Status:
      Not Required

      Description

      The getDisplayName() does not handle the situation where the person or group does not exist.

      Since we can not depend on people being retrievable from these services indefinitely, all retrievals must be checked for null-ness before being used.

          public String getDisplayName() {
          	if (isUserRequest()) {
          	    return getPerson().getName();
          	} else if (isGroupRequest()) {
          		return getGroup().getName();
          	} else if (isRoleRequest()) {
          		return getRoleName();
          	}
          	return "";
          }
      

        Activity

        Hide
        Jonathan Keller added a comment -

        Potential Patch:

        Index: src/main/java/org/kuali/rice/kew/actionrequest/ActionRequestValue.java
        ===================================================================
        --- src/main/java/org/kuali/rice/kew/actionrequest/ActionRequestValue.java	(revision 1599)
        +++ src/main/java/org/kuali/rice/kew/actionrequest/ActionRequestValue.java	(revision 1600)
        @@ -251,9 +251,19 @@
         
             public String getDisplayName() {
             	if (isUserRequest()) {
        -    	    return getPerson().getName();
        +    		Person p = getPerson();
        +    		if ( p != null ) {
        +    			return getPerson().getName();
        +    		} else {
        +    			return getPrincipalId();
        +    		}
             	} else if (isGroupRequest()) {
        -    		return getGroup().getName();
        +    		Group g = getGroup();
        +    		if ( g != null ) {
        +    			return getGroup().getName();
        +    		} else {
        +    			return getGroupId();
        +    		}
             	} else if (isRoleRequest()) {
             		return getRoleName();
             	}
        
        Show
        Jonathan Keller added a comment - Potential Patch: Index: src/main/java/org/kuali/rice/kew/actionrequest/ActionRequestValue.java =================================================================== --- src/main/java/org/kuali/rice/kew/actionrequest/ActionRequestValue.java (revision 1599) +++ src/main/java/org/kuali/rice/kew/actionrequest/ActionRequestValue.java (revision 1600) @@ -251,9 +251,19 @@ public String getDisplayName() { if (isUserRequest()) { - return getPerson().getName(); + Person p = getPerson(); + if ( p != null ) { + return getPerson().getName(); + } else { + return getPrincipalId(); + } } else if (isGroupRequest()) { - return getGroup().getName(); + Group g = getGroup(); + if ( g != null ) { + return getGroup().getName(); + } else { + return getGroupId(); + } } else if (isRoleRequest()) { return getRoleName(); }
        Hide
        Shannon Hess added a comment -

        This has been fixed. If the person is null, I just let it fall through and return an empty string since the principal ID can be sensitive information.

        Show
        Shannon Hess added a comment - This has been fixed. If the person is null, I just let it fall through and return an empty string since the principal ID can be sensitive information.

          People

          • Assignee:
            Shannon Hess
            Reporter:
            Jonathan Keller
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Structure Helper Panel