I have a problem configuring the Access permission for creating Image and Gallery content.
For the admin, I have no problem, but for authenticated user, they cannot access the node.
I have search through the Access Control page, but there is no Image or Gallery content creation permission.
Is this a bug?
I hope you can fix this as soon as possible, because your module is great!!!
Thanks.

You can visit my site at basileateens.com

Comments

babruix’s picture

Version: 5.x-1.0-alpha2 » 5.x-1.x-dev
Assigned: Unassigned » babruix
Status: Active » Needs review

Yes, authors make this module very fast and didn`t made permissions control!
Solution is to add this code to yagm.module:

/**
 *  Implementation of hook_perm.
 */
function yagm_perm() {
  return array('create gallery', 'edit own galleries');
}
 
/**
 * Implementation of hook_access.
 */
function yagm_access($op, $node) {
  global $user;
  if ($op == 'create') {
    return user_access('create gallery');
  }
  if ($op == 'update' || $op == 'delete') {
    if (user_access('edit own galleries') && ($user->uid == $node->uid)) {
      return TRUE;
    }
  }
}