Skip to content
This repository has been archived by the owner on Aug 18, 2024. It is now read-only.

Rename 'administer group' permission to 'administer organic groups' #657

Closed
pfrenssen opened this issue Jul 10, 2020 · 2 comments · Fixed by #661
Closed

Rename 'administer group' permission to 'administer organic groups' #657

pfrenssen opened this issue Jul 10, 2020 · 2 comments · Fixed by #661

Comments

@pfrenssen
Copy link
Contributor

pfrenssen commented Jul 10, 2020

A user can be given a global permission to give them access to manage all groups in the website. This permission is called administer group, but there are a few problems with this permission:

  1. It is not properly namespaced, and is conflicting with the same permission from the Group module.
  2. It is confusing in the context of Organic Groups since it seems to imply the permission is only valid for a single group entity.

I had a look at why this is called as such and it is for historical reasons. OG originally had a bunch of permissions such as administer group users, administer group permissions and at some point a new global permission was added called administer organic groups (ref commit 44d6a32). Then it was renamed to administer group in a gigantic commit which had the intention back in 2010 to rename Organic Groups to Group (ref commit ec296b4). This plan was abandoned later on and the name "Organic Groups" was kept, but the permission wasn't changed back.

Let's call it "administer organic groups" again so we don't cause any conflicts with the Group module, but keep a B/C layer in place for people upgrading their sites from D7.

@amitaibu
Copy link
Member

Let's call it "administer organic groups" again

👍

@pfrenssen
Copy link
Contributor Author

pfrenssen commented Jul 10, 2020

I started on this but there is a small complication: in D7 the administer group permission is both a global (Drupal) permission and a group permission, and in the D8 code we have been using them interchangeably.

Here is the relevant section from the D7 module:

function og_permission() {
  return array(
    'administer group' =>  array(
      'title' => t('Administer Organic groups permissions'),
      'description' => t('Administer all groups and permissions.'),
    ),
  );
}

function og_og_permission() {
  // ...
  $perms['administer group'] = array(
    'title' => t('Administer group'),
    'description' => t('Manage group members and content in the group.'),
    'default role' => array(OG_ADMINISTRATOR_ROLE),
    'restrict access' => TRUE,
  ); 
  // ...
}

I started to do a global search/replace operation to fix this, but we'll have to look at each individual case whether it is intended to be the group level permission or the global permission.

I suggest we keep the administer group group level permission, there is no conflict here, and it will help us to differentiate between both.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants