The My Reservation tab is very useful, but it is missing for regular users. I can't seem to find a permission or other setting in the view that would enable this for everyone.

Comments

arosboro’s picture

I figured this out.

In the view for My Reservations, there is a php validator for UID. It is set to:

global $user;

if ($context->uid == $user->uid && user_access('create reservations')) {
return TRUE;
}

if (user_access('manage_reservations')) {
return TRUE;
}

return FALSE;

Changing the first conditional statement to the following resolves the issue:

if($argument[0] == $user->uid && user_access('create reservations')) {

darrick’s picture

Category: support » bug
Status: Active » Needs review

I've committed your fix here: http://drupalcode.org/project/merci.git/patch/07bdc15

Thanks

darrick’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

memcinto’s picture

Issue summary: View changes

7.x-2.0

The above PHP validation code did not work for me. What I used was:

global $user;
if($argument == $user->uid && user_access('create merci_reservation content')) {
  return TRUE;
}
if (user_access('manage reservations')) {
  return TRUE;
}
return FALSE;

Note no underscore in 'manage reservations' and $argument is a variable, not an array. Also node the changed user_access argument in the first if statement.

This allows a user with 'create merci_reservation content' to view their own reservations, but not someone else's reservations. This also allows a user with 'manage reservations' to view someone else's reservations.