I have "teachers" who are the only ones able to post to their groups, but they are all given "parent" roles which are read-only to have access to all other groups, then they are elevated to "teachers" for their own groups. They are not admins for their groups, as I don't want them editing their group pages. I do want to give them the ability to email their groups. Loosely based on this: http://drupal.org/node/158370 I created this line in og.module:
$items[] = array('path' => 'node/'. arg(1). '/email', 'title' => t('E-mail'), 'callback' => 'drupal_get_form', 'callback arguments' => array('og_email_form', arg(1)), 'access' => user_access('e-mail all members of a group'), 'type' => MENU_LOCAL_TASK, 'weight' => 7);
This successfully shows the email tab, but when I click on it, my user gets an access denied error. If the user is given the "teacher" role (which has the above permission), it works fine. It gives the error only when the user is given the "parent" role which does not have the above permission, and has the "teacher" role for this particular group.

I did install this patch: og_user_roles.module.5.x-2.3.patch from http://drupal.org/node/167180 because it looked like it was a similar situation, but it didn't help.

Any ideas?

Comments

somebodysysop’s picture

Assigned: Unassigned » somebodysysop
StatusFileSize
new21.89 KB

If we're lucky, this patch will work. However, this patch MUST be applied against OG User Roles release 5.x-2.3.

somebodysysop’s picture

Status: Active » Needs review
cindyr’s picture

StatusFileSize
new21.47 KB

I'm having trouble with the patch. I had 5.x-2.2, so I upgraded to 2.3 and all worked well. Then I tried to install the patch, but only 3 out of the 18 hunks succeeded, and those were offset by either 19 or 25 lines. I'm not comfortable enough with the code to go in and do this manually yet, how can I fix this? Is there a different patch that needs to be applied first? I attached the .rej file it created if that helps.

somebodysysop’s picture

StatusFileSize
new21.89 KB

Re-ran patch. Came up exact same. Attaching again. Again, it's for release 2.3.

cindyr’s picture

It very well may be user error, I could easily be at fault as I often am, but I tried uploading the 2.3 published release again and this time it only gave me two errors out of 18, which means the first time was surely my bad. Since I still had errors I downloaded the latest from CVS and uploaded that, and the patch succeeded! Better yet, my og "email tab" access hack is working perfectly. Whatever you did solved my problem - many many thanks!

~cindyr

somebodysysop’s picture

Status: Needs review » Fixed

Great!

somebodysysop’s picture

Status: Fixed » Closed (fixed)

Modifications in version 5.x-2.4 which has just been released.