1

How to add new group permissions? describes how add new group permissions when using the Drupal 7 version of the module.

function [mymodule]_group_permission() {
  return array(
    'schedule publishing of nodes' => array(
      'title' => t('Schedule content publication'),
      'description' => t('Allows users to set a start and end time for content publication'),
    ),
    'view scheduled content' => array(
      'title' => t('View scheduled content list'),
      'description' => t('Allows users to see all content which is scheduled.'),
    ),
  );
}

This does not appear to be the case in Drupal 8.
How can I add my own custom permissions to the group permissions screen, in Drupal 8?

1

I found the answer to this question here: https://www.drupal.org/project/group/issues/2959912

Create a .yml file, for example: my_module.group.permissions.yml

It should contain:

access group menu edit:
  title: 'Edit group menu'
  description: 'Allow users to edit the group menu'

First line is the permission itself. I did this. Flushed cache, and my permissions now appear in Group module permissions screen under "My Module".

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.