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.

Issue fork votingapi-2907696

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

mroycroft created an issue. See original summary.

mroycroft’s picture

StatusFileSize
new7.89 KB

Here is the patch, and a test is included.

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

Status: Needs work » Active
StatusFileSize
new7.13 KB

@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

StatusFileSize
new7.05 KB

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

StatusFileSize
new6.89 KB

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

StatusFileSize
new410 bytes
new6.9 KB

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

StatusFileSize
new7.21 KB

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

StatusFileSize
new7.21 KB
new667 bytes

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
StatusFileSize
new7.22 KB
new351 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

Status: Needs work » Needs review
StatusFileSize
new7.27 KB
new514 bytes

Not doing too well tonight - I keep missing little things. Let's see if I got it right this time:

Anonymous’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

StatusFileSize
new7.34 KB

Rerolled the patch to add return type hints to the new test functions.

tr’s picture

Version: 8.x-3.x-dev » 4.0.x-dev
tr’s picture

I put #23 into an MR for the 4.0.x branch, so the testbot can test it.

tr’s picture

Category: Task » Feature request

  • tr committed 1f392236 on 4.0.x
    Issue #2907696 by tr, pifagor, mroycroft, kevin.dutra: Unable to see any...
tr’s picture

Status: Reviewed & tested by the community » Fixed

Merged.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.