The existing options:

1) "Default Basic Group Role for new group subscribers." applies to all subscribers.
2) "Default Founder Role for users who create groups." applies to all group owners (creators)
3) What about subscribers who become group admins?

I'd like to be able to specify a role that group admins acquire. This has an excellent use case, whereby normal users are not able to add certain content. Group admins would be able to edit all content in the group and create all sorts of new content only within that group.

Comments

somebodysysop’s picture

3) What about subscribers who become group admins?

This one probably isn't so tough. You would apply the role when a user is made a group admin. However, this one:

2) "Default Founder Role for users who create groups." applies to all group owners (creators)

Remember that the founder is also a group admin. Should he get the group admin role also? If so, then how do we make this happen retroactively since one may have several groups already when you apply this?

scedwar’s picture

I would say yes, for the moment, as I can't imagine a situation where you would not want to give the owner at least the permissions a group admin has. How to do so retroactively? For my purposes, I don't mind, but I assumed it could adopt the same behaviour as the existing code for group owners and group members (but I don't know what that is!). For my particular purpose it won't matter.

somebodysysop’s picture

Assigned: Unassigned » somebodysysop
Status: Active » Postponed (maintainer needs more info)

So, your suggestion is to have an option to automatically assign a role to a user who becomes a group admin? That means if the user is demoted from group admin, the role will need to be revoked?

scedwar’s picture

Yes. It is simply a way for an owner (or admin) to elevate a single user to an admin status both for the group and as a role within that group. As it stands, a group admin does not have much control over the group content beyond that of a normal member.

In my scenario, this would allow a user to become a moderator or editor for all posts in a group, but not outside the group. This has been requested as a use case on groups.drupal.com, and this would be an implementation of that.

somebodysysop’s picture

The idea here is to automatically assign a role to a user when he is promoted to group admin. The problem is what to do when a group_admin user is demoted.

The process in OG which creates/updates group admins is this:

    og_save_subscription($node->nid, $account->uid, array('is_admin' => 1));

The problem is that we don't know when a user is being demoted. This line could refer to any new user who is not an admin:

    og_save_subscription($node->nid, $account->uid, array('is_admin' => 0));

My guess is that I would use hook_og('user insert') or hook_og('user update') to find out the "is_admin" status of user being inserted or updated:

    $status = $args['is_admin']

If $status == 1

    Add group admin role to user's group roles

If $status == 0

    Remove the group admin role (if it exists)

The problem is that every time a user is inserted or updated, I would have to run this query. Not efficient. Also, if a user is manually assigned the group admin role, and is not a group admin, the role will automatically be deleted.

What do you think?

somebodysysop’s picture

Version: 5.x-2.6 » 5.x-2.7
Status: Postponed (maintainer needs more info) » Needs review
StatusFileSize
new5.31 KB

Apply the attached patch to a clean download of the 2.7 release.

somebodysysop’s picture

Status: Needs review » Fixed

No response. Will assume this is fixed.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.