Problem/Motivation

Users who wish to view a report on what they have voted on, will not have the means to do so currently, because the default access control handler for the Vote entity will return a neutral result, which will not allow the user to view any voting data, even their own voting data.

Proposed resolution

Provide an access control handler for the Vote entity, and a few basic permissions to regulate access to viewing the Vote entity.

Remaining tasks

Review patch.

User interface changes

None.

API changes

None.

Data model changes

None.

CommentFileSizeAuthor
#23 2907696-23-access-control-handler.patch7.34 KBTR
#20 interdiff-18-20.txt514 bytesTR
#20 2907696-20-access-control-handler.patch7.27 KBTR
#18 interdiff-16-18.txt351 bytesTR
#18 2907696-18-access-control-handler.patch7.22 KBTR
#16 interdiff-15-16.txt667 bytesTR
#16 2907696-16-access-control-handler.patch7.21 KBTR
#15 2907696-15-access-control-handler.patch7.21 KBTR
#14 2907696-14-access-control-handler.patch6.9 KBTR
#14 interdiff-13-14.txt410 bytesTR
#13 2907696-13-access-control-handler.patch6.89 KBTR
#11 add-access-control-handler-2907696-11.patch7.05 KBkevin.dutra
#5 add-access-control-handler-2907696-5.patch7.13 KBpifagor
#2 add-access-control-handler-2907696-2.patch7.89 KBmroycroft
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mroycroft created an issue. See original summary.

mroycroft’s picture

mroycroft’s picture

Status: Active » Needs review
jhedstrom’s picture

Status: Needs review » Needs work
Issue tags: +Needs reroll

This patch no longer applies to the latest code.

pifagor’s picture

@jhedstrom
Please test. I changed patch, but I didn't test it

pifagor’s picture

pifagor’s picture

Status: Active » Needs review
mmjvb’s picture

Ignore, my mistake

pifagor’s picture

Please test patch

pifagor’s picture

kevin.dutra’s picture

Minor reroll to address the patch failing to apply. (EOF newline issue in the permissions file)

rpayanm’s picture

Issue tags: -Needs reroll
TR’s picture

Patch in #11 still applies, and comes with a test so it can be tested!

I made only two minor changes to the patch. Specifically, in the test case, $modules should be protected and we don't need to use StringTranslationTrait or t(). Other than that everything looks good to me.

TR’s picture

Re-roll because #13 was using the old simpletest Trait instead of the new one. See the interdiff, it's only a change to one "use" statement.

TR’s picture

Re-rolled #14 against current HEAD. The only difference is in VoteAccessControlHandler.php, and the previous patch is old enough that a proper interdiff can't be made for that file.

TR’s picture

Rearranged the switch statement to satisfy phpcs.

Status: Needs review » Needs work

The last submitted patch, 16: 2907696-16-access-control-handler.patch, failed testing. View results

TR’s picture

Status: Needs work » Needs review
FileSize
7.22 KB
351 bytes

Stupid mistake - forgot the return.

Status: Needs review » Needs work

The last submitted patch, 18: 2907696-18-access-control-handler.patch, failed testing. View results

TR’s picture

jernejmramor’s picture

Hello,

I have tested the patch from #20 and it is working for me.

igork96’s picture

Status: Needs review » Reviewed & tested by the community

I gave it a view and can confirm it's working.

TR’s picture