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

An anonymous user can vote only once (6.2.x)

    Details

      Description

      STEPS TO REPRODUCE
      1.- Instance a Polls Display portlet with a new poll
      2.- Add the permission "Add Vote" for the Guest role for the previous created poll
      3.- Log out and vote using the Guest user
      4.- Open a Private browsing window and vote

      EXPECTED
      A new vote should be possible. In previous versions (6.0.x) it was possible

      ACTUAL
      An error message is displayed "You may only vote once"

      EXPLANATION
      In previous versions BaseServiceImpl.getUser() thows a PrincipalException but not anymore and in 6.2 returns the default user.
      In previous version in PollsVoteServiceImpl.addVote() a new userId was created.
      This implementation works but, it creates orphaned data (userId)?

      SOLUTION
      6.2. changes the way PrincipalThreadLocal is populated. For unauthentitated users, the thread local contains the default user id. As a result, the polls voting service logic stops working. Solution is to change that specific piece of logic.

      We'll use this LPS to implement the solution for 6.2.x, which consists in preserving the original behavior.
      For master, the solution has to be discussed as there are different alternatives such as allowing anonymous votes, force users to provide the email address, etc...

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                beck.liu Beck Liu
                Reporter:
                sergio.sanchez Sergio Sanchez
                Participants of an Issue:
                Recent user:
                Esther Sanz
              • Votes:
                1 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

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

                  Packages

                  Version Package
                  6.2.X EE