The way the module is working atm, granting the permission to "administer own group vocabulary" grants the permission to administer any group permissions. Assuming this is working as intended the option should probably be renamed as suggested in the title?

CommentFileSizeAuthor
#1 og_vocab-renamed-permission.patch1.33 KBTim_O
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Tim_O’s picture

Status: Active » Needs work
FileSize
1.33 KB

After having found out how to create patch-files I looked into renaming this. Just wanted to make another step in getting used to contributing (and getting rid of items on "my" list). And renaming that itself was easy, I submit the patchfile enclosed. However this patchfile would only fix this for new installations, existing installations having granted the right "administer own group vocabulary" to ANY role will need to get according entries in the permission table fixed! So don't apply if you don't know what you're doing!

So, to properly fix this, we will need an update routine in og_vocab.install? I am guessing here, but there's something similar in it. In table permission there is an entry for each role. For each role having the entry "administer own group vocabulary", this needs to be renamed to "administer group vocabularies". I figured out the following code to achieve this on the MySQL-CLI:
UPDATE permission SET perm = REPLACE(perm, 'administer own group vocabulary', 'administer group vocabularies');
But I don't know how to properly embedd this into code. I found a snippet in og_vocab.install where it might fit. Something like

function og_vocab_update_xyz() {
  $ret = array();
  db_query("UPDATE permission SET perm = REPLACE(perm, 'administer own group vocabulary', 'administer group vocabularies')");
  return $ret;
}

could do the job. Don't know what xyz (a number) specifies. The number of the update-function? The version to apply the update on? Also I don't understand why there is an empty array created and returned. Can anyone point me in the right direction on this? Is this otherwise sound?

Tim_O’s picture

Oh, and there is a de.po file in the translations folder. In this the following lines would need to be changed (showing the changed lines here):

153 #: og_vocab.module:112
154 msgid "administer group vocabularies"
155 msgstr "Gruppen-Vokabulare verwalten"

Was this delivered with the module? For me all the german Umlaute (ä,ö,ü) are cryptic in this file, quess this is something about used language-pages or something? So no clue how to fix these for all atm.

amitaibu’s picture

Component: User interface » Code
Priority: Minor » Normal
Status: Needs work » Needs review

@Tim_O,
Thanks, I'll review your patch in a couple of days (busy porting OG7)

fadgadget’s picture

Hi this still seems to be the way with the latest 6.1.dev version. Anyone that admins a groups seems to be able to edit the taxonomies of ANY group that they are a member of. Is there a solution for this as its a bit of a bugger.

thanks