Permission not working properly

riz - November 11, 2006 - 01:24
Project:shazamgallery
Version:4.7.x-1.x-dev
Component:User interface
Category:bug report
Priority:normal
Assigned:Unassigned
Status:needs review
Description

I allowed an 'authenticated user role' to create shazamgallery. However, when I click 'create content', the option to create a gallery is not shown, but the same option is visible when logged in as an administrator. When I try to access gallery creation form using http://localhost/drupal/?q=node/add/gallery , it would simply return the 'create content' page.

Am I doing something wrong or is it a problem with shazamgallery module? Any fix?

#1

alynner - June 1, 2007 - 21:31
Status:active» needs review

I just came across your posting because I was having the same problem. I'm not sure if anyone is using this module any more because it doesn't seem to be maintained, but anyway, I added the following hook to shazamgallery.module and it appears to have fixed the problem:

/**
* Implementation of hook_access().
*/
function shazamgallery_access($op, $node) {
  global $user;

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

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

cheers
alynner

 
 

Drupal is a registered trademark of Dries Buytaert.