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

UserGroup.Suggestion does not return subgroups

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 10.10
    • Fix Version/s: 11.x
    • Component/s: Automation

      Description

      1. create a group mygroup1
      2. create a group mysubgroup1
      3. create a user myuser1
      4. add subgroup1 as a member of mygroup1
      5. add myuser1 as a member of mygroup1
      6. Try the following curl command:
        curl -fsSL -u Administrator:Administrator -H "Content-Type: application/json+nxrequest" -X POST https://nightly.nuxeo.com/nuxeo/site/automation/UserGroup.Suggestion -d '{"params":{"groupRestriction":"mygroup1"},"context":{}}'
        [
          {
            "firstName": "myuser1",
            "lastName": "myuser1",
            "tenantId": null,
            "groups": [],
            "company": "",
            "email": "myuser1@aze.ert",
            "username": "myuser1",
            "id": "myuser1",
            "entity-type": "user",
            "type": "USER_TYPE",
            "prefixed_id": "user:myuser1",
            "displayLabel": "myuser1 myuser1",
            "displayIcon": true
          }
        ]
        

        Only the users are returned.

      7. this is due to the following part of code:
        https://github.com/nuxeo/nuxeo/blob/10.10/nuxeo-features/nuxeo-automation/nuxeo-automation-features/src/main/java/org/nuxeo/ecm/automation/core/operations/users/SuggestUserEntries.java#L151
        Once the group restriction is set, the search type is thus ignored.

      Expected behavior: to match the usual behavior, if no searchType is specified both users and groups/subgroups should be returned.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated: