Project:Decisions
Version:6.x-1.3
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:needs work

Issue Summary

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

Comments

#1

Status:active» needs review

Please mark your bug reports properly so I don't miss those precioussss patches. ;)

#2

Status:needs review» needs work

The patch is backward, from what I can tell. It also includes whitespace problems:

+   if (user_access('manage any decisions', $account)) {
+   return TRUE;
+   }

Furthermore, why can't OGUR use the regular "create/edit/edit own/delete " permissions? Sounds like a bug on their end. If you look at the poll.module, there's no such thing as a "manage" permission...