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

Fix retrieval of personal workspace for user with special characters

    XMLWordPrintable

    Details

    • Release Notes Summary:
      Personal workspace creation handles special characters.
    • Backlog priority:
      550
    • Upgrade notes:
      Hide

      Retrieving a User Workspace through UserWorkspaceService requires that the user (NuxeoPrincipal) exists in the Nuxeo Platform.

      Show
      Retrieving a User Workspace through UserWorkspaceService requires that the user (NuxeoPrincipal) exists in the Nuxeo Platform.
    • Sprint:
      nxplatform 11.1.28
    • Story Points:
      5

      Description

      Steps to reproduce:

      1. Log in and go to the JSF UI
      2. Go to Admin > Users & Groups
      3. Click the "Create a New User" button
      4. Create a first user with username a-b and don't check the "Create another" box
      5. Click on the "Back to the List" button
      6. Click the "Create a New User" button
      7. Create a first user with username a_b

      Now the following actions will fail:

      • GET the path endpoint with the theoritical path of a_b workspace
        http://localhost:8080/nuxeo/site/api/v1/path/default-domain/UserWorkspaces/a_b
        

        returns a 404 error

        {"entity-type":"exception","status":404,"message":"/default-domain/UserWorkspaces/a_b"}
        
      • cURL command to get the user workspaces from the GetUserWorkspace' operation
        curl -X POST 'http://localhost:8080/nuxeo/site/automation/User.GetUserWorkspace' -u a_b:password -H 'content-type: application/json' -H 'X-NXproperties: *' -H 'X-NXRepository: default' -H 'X-NXVoidOperation: false' -d '{"params":{},"context":{}}'
        

        => returns the personal workspace for a-b

        {"entity-type":"document","repository":"default","uid":"80172e2a-a9b2-4fed-86dc-e83510855485","path":"/default-domain/UserWorkspaces/a-b", ...
        

      AbstractUserWorkspaceImpl#getCandidateUserWorkspaceNames produces the alternative names for the personal workpace

          protected PathRef getExistingUserWorkspace(CoreSession session, PathRef rootref, Principal principal,
                  String username) {
              PathRef freeRef = null;
              for (String name : getCandidateUserWorkspaceNames(username)) {
                  PathRef ref = new PathRef(rootref, name);
                  if (session.exists(ref)
                          && session.hasPermission(session.getPrincipal(), ref, SecurityConstants.EVERYTHING)) {
                      return ref;
                  }
      

      => this permission check uses a "system" user

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 0 minutes
                  0m
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 day, 1 hour, 30 minutes
                  1d 1h 30m