Add permission to translate the Group

Created on 23 December 2020, about 4 years ago
Updated 27 January 2025, 8 days ago

Problem/Motivation

Currently there is no way to set the permission to translate a group in the Group Permissions overview. When the core module "Content translation" is enabled and the user has the permission to translate entities a "Translate" tab appears on the Group and this allows the user to translate the Group.

The only distinction which can be set is:

  1. Add site permission "translate group entity" to give a user with a given site role the permission to translate the group entity
  2. Add site permission "translate editable entities" to give a user with a given site role the permission to translate the group they have permission to edit (Drupal core 9.1 and up)

For me this distinction is not enough as I would like to be able to give this permission to translate only to group members (with group role "Translator").

Steps to reproduce

  • Enable modules: Group, Content Translation
  • Create new Group Type
  • Add a new Language
  • Enable translation for the Group entity
  • Go to the Group Type permissions overview and notice there is no way specify who can translate the group
  • Go to the Group Type permissions overview and notice there is no way to set who can translate the group

Proposed resolution

I would like to add a group permission so that this permission can be assigned to group roles and thus the translation of the Group can be handled within the group context itself.

Technically this can be done by:

  • Adding a group permission "translate group";
  • Overriding content_translation.overview_access and content_translation.manage_access services with our own Classes to explicitly allow or deny access on the routing;
  • Adding a Group Translation handler to override the public method getTranslationAccess on ContentTranslationHandler;

Remaining tasks

  • Determine if the permission to "translate group" should only be added when the content translation module is enabled (and/or the Group entity can be translated). Currently it is added in the Yaml file.
Feature request
Status

Needs review

Version

1.0

Component

Code

Created by

🇳🇱Netherlands jaapjan

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇬🇧United Kingdom lazysoundsystem

    Minor changes to the patch in #10 so it applies to 2.3.x and 3.3.x

    Wondering why there isn't more demand for this - is there something I'm missing?

Production build 0.71.5 2024