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

Fix creating document creator not being contributor

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 10.10
    • Fix Version/s: None
    • Component/s: Tests, Web UI

      Description

      When using the nuxeo-web-ui-ftest framework, when provisioning, the created documents are being created by a chosen user but the contributor is still Administrator. The creator of a document should also be a contributor.

      Example in step used in search.feature

      • search.js
        Given(/^I have the following documents$/, (table) => {
          browser.pause(1000);
          const tasks = table.rows().map(row => () => {
            const doc = fixtures.documents.init(row[0]);
            doc.name = row[1];
            doc.properties = {
              'dc:title': row[1],
              'dc:nature': row[2],
              'dc:subjects': [row[3]],
              'dc:coverage': row[4],
            };
            if (row[0] === 'Note') {
              doc.properties = {
                'dc:title': row[1],
                'dc:nature': row[2],
                'dc:subjects': [row[3]],
                'dc:coverage': row[4],
                'note:note': 'Lorem Ipsum',
              };
            }
            // create the document
            return fixtures.documents.createWithAuthor(row[6], doc, row[5]).then((docWithAuthor) => {
              if (row[7].length > 0) {
                return fixtures.collections.addToCollection(docWithAuthor, row[7]).then((docInCollection) => {
                  if (row[8].length > 0) {
                    return fixtures.documents.addTag(docInCollection, row[8]).then((docWithTag) => {
                      if (row[9].length > 0) {
                        return fixtures.documents.attach(docWithTag, fixtures.blobs.get(row[9]));
                      }
                    });
                  }
                });
              }
            });
          });
          return tasks.reduce((current, next) => current.then(next), Promise.resolve([]));
        });
        
      • document.js:
      createWithAuthor: (parent, document, username) => nuxeo.repository()
          .create(parent, document)
          .then((doc) => {
            liveDocuments.push(doc.uid);
            if (username) {
              return doc.set({
                'dc:creator': username,
              }).save();
            }
            return doc;
          }),
      

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:

                Time Tracking

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 30 minutes
                30m

                  PagerDuty

                  Error rendering 'com.pagerduty.jira-server-plugin:PagerDuty'. Please contact your Jira administrators.