My search doesn't indicate if this has been addressed or not. Our members can create their own book review using the book review module, but they cannot edit their own review after it's been submitted. The access roles only have create and access options. Setting edit for page or book page doesn't do the trick either. Is this possible, or does this need to be a feature request? Using Drupal 4.6.0 (will upgrade to 4.6.1 this weekend). Thanks.

Comments

jandersen’s picture

Title: User cannot edit own bookreview? » Same here...User cannot edit own bookreview?

Anyone else having this problem?

Emiliano’s picture

Please, try this:

On line 28, replace this code:

function bookreview_access($op, $node) {
  if ($op == 'view' && user_access('access bookreviews')) {
    return $node->status;
  }

  if ($op == 'create') {
    return user_access('create bookreviews');
  }
}

by this:

function bookreview_access($op, $node) {

  global $user;

  if ($op == 'view' && user_access('access bookreviews')) {
    return $node->status;
  }

  if ($op == 'create') {
    return user_access('create bookreviews');
  }

  if ($op == 'update' || $op == 'delete') {
    if (user_access('create bookreviews') && ($user->uid == $node->uid)) {
      return TRUE;
    }
  }
}

This way, the author can update or delete its review.
Try it on a test server before using it on a production one, ok?
Cheers,
Emiliano.

CrowChick’s picture

That fix didn't do the trick for me.

brenda003’s picture

Priority: Normal » Minor

It worked for me just perfectly.

brenda003’s picture

Status: Active » Closed (fixed)