Uploaded image for project: 'PUBLIC - Liferay Commerce'
  1. PUBLIC - Liferay Commerce
  2. COMMERCE-7495

UserId for CommerceOrderEngine.transitionCommerceOrder()

    Details

    • Type: Feature Request
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.1.2, 7.3 FP2
    • Fix Version/s: None
    • Component/s: Order Management
    • Labels:
      None

      Description

      CommerceOrderEngine has the following method:

      public CommerceOrder transitionCommerceOrder(
      {{ CommerceOrder commerceOrder,}}
      {{ int orderStatus,}}
      {{ long userId)}}
      throws PortalException;

      This method takes a userId as the third parameter.

      This is supposed to be the userId of the User on behalf of whom the transition will be triggered. The CommerceOrder object itself already bears the userId of the User who originated the CommerceOrder.

      Expected behaviour:

      When calling transitionCommerceOrder with a userId, permission checks will be done against the User's permission with the aforementioned userId.

      Actual behaviour:

      The userId is obtained from the PermissionChecker of the PermissionThreadLocal.

      As a consequence, if for example I'm running the transitionCommerceOrder method from a ModelListener, the PermissionThreadLocal will handover the PermissionChecker associated to the user who triggered the ModelListener.

        Attachments

          Activity

            People

            Assignee:
            riccardo.alberti Riccardo Alberti
            Reporter:
            fabian.bouche Fabian Bouché
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:

                Packages

                Version Package