Edit problem with OG User Roles

lechuck - November 5, 2009 - 13:43
Project:Decisions
Version:6.x-1.3
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Description

Hi,
When used with OGUR the module there is a problem trying to modify a decision content published
as a group content.
it says
You do not have permission to edit or delete this content type (type) in Group: group

After a little debug i discovered that OG User Roles search for perms containing "manage" o "edit"
so i write a little patch to add manage own decisions and manage any decisions to decisions module
and now it seems to work fine.

diff -Naur ../decisions/decisions.module decisions/decisions.module
--- ../decisions/decisions.module       2009-11-05 14:18:32.000000000 +0100
+++ decisions/decisions.module  2009-08-20 00:34:36.000000000 +0200
@@ -44,10 +44,8 @@
     return user_access('delete decisions', $account);
   }
   if ($op == 'update') {
-   if (user_access('manage any decisions', $account)) {
-   return TRUE;
-   }
-   if (user_access('manage own decisions', $account) && ($account->uid == $node->uid)) {
+    /* you can update it if you can create it, provided it is your own... */
+    if (user_access('create decisions', $account) && ($account->uid == $node->uid)) {
       return TRUE;
     }
   }
@@ -185,7 +183,7 @@
  * Implementation of hook_perm().
  */
function decisions_perm() {
-  return array('create decisions', 'delete decisions', 'view decisions', 'manage own decisions','manage any decisions', 'vote on decisions', 'cancel own vote', 'administer decisions', 'inspect all votes', 'view electoral list', 'remove voters');
+  return array('create decisions', 'delete decisions', 'view decisions', 'vote on decisions', 'cancel own vote', 'administer decisions', 'inspect all votes', 'view electoral list', 'remove voters');
}

/**

AttachmentSize
decision.patch1.19 KB
 
 

Drupal is a registered trademark of Dries Buytaert.