Add permission for "vote on own content"

Created on 21 March 2025, about 1 month ago

Problem/Motivation

I want to show a read only widget if the content is owned by the user, currently this is not possible.

We should add a permission for "vote on own ENTITY_TYPE:BUNDLE:FIELD_NAME"
and check for it in the canVote() method

If you don't think we should add a new permission we should make canVote() alterable so admins can decide to return false under certain conditions.

There was a request for the latter a while ago but it was denied see: #2981551: Allow to alter canVote β†’

✨ Feature request
Status

Active

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States loze Los Angeles

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @loze
  • πŸ‡ΊπŸ‡ΈUnited States loze Los Angeles

    For the record, I'm actually in favor of doing both.

    A permission is easy to set up and straightforward, but allowing admins to control if something should be able to be voted on by a specific user is a nice feature. It's not really about altering the permission (which appears to be the reasoning for the request being denied).

    Let's say I wanted to prevent nodes from being voted on if its tagged with a term or has some other arbitrary field value, or is older than a specific date. Having an alter hook here would allow for this.

  • Merge request !37add permission for voting on own content β†’ (Open) created by loze
  • Pipeline finished with Failed
    about 1 month ago
    Total: 148s
    #454395
  • Pipeline finished with Failed
    about 1 month ago
    Total: 190s
    #454467
Production build 0.71.5 2024