Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-24741

UserLocalServiceImpl.addDefaultGroups causes an issue when you have the same portal account name as an existing site

    Details

    • Branch Version/s:
      6.1.x
    • Backported to Branch:
      Committed
    • Fix Priority:
      3
    • Added to Fix Pack:
      Added

      Description

      Download and install Liferay 6.1 CE GA 1
      Run Liferay
      Login as test@liferay.com
      Go to Control panel / Sites
      Create new site called 'myCompany' with the Membership Type restricted
      Go to Control panel / Portal Settings / General
      Update Main Configuration / Name with the same name: 'myCompany' and save you changes
      Go to Portal Settings / Users and Organizations / Default User Associations
      Update Sites with 'myCompany' and save you changes

      Go to Users and Organizations and create a new user

      After you have created the user go to users detail page go to Sites tab
      User has now one site myCompany which is the default guest site "community" instead of the site you have created.
      This happens because in Liferay 6.1 you have changed the code in UserLocalServiceImpl.addDefaultGroups :

      UserLocalServiceImpl.addDefaultGroups(long userId)

      Company company = companyPersistence.findByPrimaryKey(
      user.getCompanyId());

      Account account = company.getAccount();

      if (defaultGroupName.equalsIgnoreCase(account.getName())) {
      defaultGroupName = GroupConstants.GUEST;
      }

      Company company = companyPersistence.findByPrimaryKey(
      user.getCompanyId());

      Account account = company.getAccount();

      if (defaultGroupName.equalsIgnoreCase(account.getName())) {
      defaultGroupName = GroupConstants.GUEST;
      }

      The issue accrues because of the following check:
      if (defaultGroupName.equalsIgnoreCase(account.getName())) {
      defaultGroupName = GroupConstants.GUEST;
      }

      Fix:
      Please make this check configurable.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  5 years, 4 weeks, 6 days ago