Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-14950

New principal.getActingUser improving on getOriginatingUser

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 6.0
    • Component/s: Core
    • Impact type:
      API change
    • Upgrade notes:
      Hide

      New API:

      NuxeoPrincipal.getActingUser()

      that never returns null, to use in preference to getOriginatingUser().

      Show
      New API: NuxeoPrincipal.getActingUser() that never returns null, to use in preference to getOriginatingUser().

      Description

      Nearly all the uses of principal.getOriginatingUser() are of the form:

      String name = principal.getOriginatingUser();
      if (name == null) {
          name = principal.getName();
      }
      

      Move that to a utility method getActingUser(), to use instead of having callers of getOriginatingUser that don't pay attention to the null case.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: