I have a role that has the og_permission to edit their own pages. So someone with administrative privileges can "assign" pages to an individual user by setting them as the author on the page. The assigned user does not require the permission to create pages themselves.

However - when og_create_perms is enabled, the "edit own %type" permission will not work unless a user also has create privileges. Users will see the edit button and can go to the edit node form, but when they attempt to submit their changes the error message generated from line 78 in og_create_perms.module will appear.

Users with edit own permission should be able to edit content they are the author of without needing to have create privileges.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jastraat’s picture

Status: Active » Needs review

I was able to fix this problem by modifying line 41 in og_create_perms.module from
if ($entity_type == 'node' && in_array($entity->type, $types)){
to
if ($entity_type == 'node' && in_array($entity->type, $types) && empty($entity->nid)){

Basically, I added a check to make sure that this is a new node. Other modules are already making sure that a user cannot edit something that they are not allowed to edit. This didn't interfere with the creation or edit any restrictions, but "edit own" works again.

cweagans’s picture

Status: Needs review » Reviewed & tested by the community
FileSize
712 bytes

Patch attached, and this works for me.

grndlvl’s picture

Reroll to adjust condition in correct function. (field validation instead of hook_node_access).

**Note this is only a change to the patch and not the specified fix.