Uploaded image for project: 'Alfresco'
  1. Alfresco
  2. ALF-4118

PersonServiceImpl - prevent direct creation of duplicate people

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.2 Enterprise, 3.4.a Community
    • Fix Version/s: 3.4.b Community
    • Component/s: Repository
    • Security Level: external (External user)
    • Labels:
      None
    • Resolution Time Custom Field:
      12 weeks, 5 days, 17 hours, 17 minutes, 54 seconds

      Description

      Possibly a non-issue, but reproduced with this (updated test):

      public void test_ALF_4118()
      {
      final String TEST_PERSON_UPPER = "TEST_PERSON";
      final String TEST_PERSON_LOWER = TEST_PERSON_UPPER.toLowerCase();

      final Map<QName, Serializable> personProps = new HashMap<QName, Serializable>();

      personProps.put(ContentModel.PROP_HOMEFOLDER, null);
      personProps.put(ContentModel.PROP_FIRSTNAME, "test first name ");
      personProps.put(ContentModel.PROP_LASTNAME, "test last name");
      personProps.put(ContentModel.PROP_SIZE_CURRENT, 0);

      AuthenticationUtil.setFullyAuthenticatedUser(AuthenticationUtil.getAdminUserName());

      RetryingTransactionHelper txnHelper = transactionService.getRetryingTransactionHelper();

      RetryingTransactionCallback<Void> callback = new RetryingTransactionCallback<Void>()
      {
      public Void execute() throws Throwable
      {
      if (! personService.personExists(TEST_PERSON_UPPER))

      { personProps.put(ContentModel.PROP_USERNAME, TEST_PERSON_UPPER); personService.createPerson(personProps); }

      return null;
      }
      };

      txnHelper.doInTransaction(callback);

      NodeRef rootNodeRef = personService.getPeopleContainer();

      personProps.put(ContentModel.PROP_USERNAME, TEST_PERSON_LOWER);

      ChildAssociationRef childAssocRef = nodeService.createNode(
      rootNodeRef,
      ContentModel.ASSOC_CHILDREN,
      QName.createQName("

      {test}

      testperson"),
      ContentModel.TYPE_PERSON,
      personProps);

      final NodeRef nodeRef = childAssocRef.getChildRef();

      nodeService.setProperty(nodeRef, ContentModel.PROP_USERNAME, TEST_PERSON_UPPER);
      }

        Attachments

          Activity

            People

            • Assignee:
              closedbugs Closed Bugs
              Reporter:
              dhulley Derek Hulley
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Date of First Response: