Drupal is a registered trademark of Dries Buytaert
Release: Drupal 10.3.6 Update released for Drupal core (10.3.6)! Release: Drupal 11.0.5 Update released for Drupal core (11.0.5)! Release: Drupal 10.2.9 Update released for Drupal core (10.2.9)! Release: Drupal 10.2.10 Update released for Drupal core (10.2.10)! Release: Drupal 10.3.7 Update released for Drupal core (10.3.7)! Release: Drupal 11.0.6 Update released for Drupal core (11.0.6)! Release: Drupal 10.3.8 Update released for Drupal core (10.3.8)! Release: Drupal 11.0.7 Update released for Drupal core (11.0.7)! Module Revived: Translation Management Tool 8.x-1.19 Module tmgmt updated after 7 months of inactivity (8.x-1.19). Usage Milestone: Account field split Module account_field_split crossed 10,000 active installs.

This module adds support for defining multiple permission sets per group type. Users that have permissions to create/edit groups can then choose which permission set will provide permissions for the group.

Features

By default, the permissions for each group role are provided at the group type level. Let's say, for example, you have a social media application where users can join groups. All groups would have the same exact permissions; if you wanted to have groups with different permissions you would need to create multiple group types.

This module allows creating multiple permission sets for each group type. You can then create a set that only allows group members to see group posts, another permission set that might allow some content types to be visible to non-members while others are visible only to members, and another permission set that makes all group content public.

Group administrators can then choose the permission set that should be used by each one of their groups.

Post-Installation

Edit the group types that you want to enable permission sets on, and select the provided checkbox.

This module does not yes provide a UI for creating/updating permission templates. Until that is implemented, a developer needs to define the permission sets as configuration in the code. Here is an example.

The naming convention is to use the ID of the group type as a prefix, then something that is meaningful for your use case. But this is just a suggestion, use the naming conventions that work for your use case. Always create a default set for each group type, whether you name it as such or not.

# group_permission_set.set.my_group_type_default.yml
langcode: en
status: true
dependencies: {  }
id: my_group_type_default
label: Default
description: 'The default permission set for groups of type My Group Type. Allows access to view published page/post content items to all anonymous and authenticated users, but only allows access to view published exclusive content items to users with the Member role in the group.'
group_type_id: my_group_type
permissions:
  my_group_type-admin: {  }
  my_group_type-anonymous:
    - 'view node:page entity'
    - 'view node:post entity'
  my_group_type-authenticated:
    - 'view node:page entity'
    - 'view node:post entity'
  my_group_type-member:
    - 'view node:page entity'
    - 'view node:post entity'
    - 'view node:exclusive entity'

You can then import the configuration using drush cim and you'll get the permission set created in the system and available to all groups of type my_group_type.

Additional Requirements

Currently, this module works only with Group version 3.

Similar projects

See #3425908: How is this module different to Group Permissions and Group Permissions Template.

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
2
Tracked since
Oct 2024
Latest release
1 year ago
Releases (12 mo)
0 ▼ from 2
Maintenance
Dormant

Releases

Version Type Core Release date
1.0.0-alpha4 Pre-release Oct 7, 2024
1.0.0-alpha3 Pre-release Oct 3, 2024