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

OrganizationLocalService hasUserOrganization does not work as expected when inheritSuborganizations=true and includeSpecifiedOrganization=false

    Details

      Description

      When the method is invoked with inheritSuborganizations=true and includeSpecifiedOrganization=false it does include the specified organization in the check (VERIFIED)

      Steps to reproduce:

      1. Create an organization and assign the test user to it
      2. Note the test user's id (e.g. 20199)
      3. Note the organization's id (e.g. 20602)
      4. Navigate to Control Panel -> Server Administration -> Script and execute the following groovy script:
      import com.liferay.portal.service.OrganizationLocalServiceUtil;
      
      long userId = 20199;
      long organizationId = 20602;
      
      boolean inheritSuborganizations = true;
      boolean includeSpecifiedOrganization = false;
      
      boolean isMember = OrganizationLocalServiceUtil.hasUserOrganization(userId, organizationId, inheritSuborganizations, includeSpecifiedOrganization);
      
      out.println(isMember);
      

      Expected: isMember should be false
      Actual: isMember is true

      Note: This issue was found while working on https://issues.liferay.com/browse/LPS-61779

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              hong.zhao Hong Zhao (Inactive)
              Reporter:
              jorge.ferrer Jorge Ferrer
              Participants of an Issue:
              Recent user:
              Brian Wulbern
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

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

                  Packages

                  Version Package
                  6.1.X EE
                  6.2.X EE
                  7.0.0 Beta 4