i am trying to set up SimpleAds module so that one of my users can view nodes created by advertisements that are added. I have checked all the necessary permissions in the Home » Administration » People screen but it is still giving the user the "Access Denied" error

any feedback on a fix would be appreciated.

CommentFileSizeAuthor
#7 permission-issue-1795174-2.patch578 bytesyvesvanlaer
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

binaryweb’s picture

Assigned: binaryweb » Unassigned
Alexpi’s picture

Change this line 152 in simpleads.module:

if (isset($node->type) && $node->type == 'simpleads' && $op == 'view' && !user_access('administer nodes', $account)) {

to this:

if (isset($node->type) && $node->type == 'simpleads' && $op == 'view' && !user_access('access ad node', $account)) {
minnur’s picture

Assigned: Unassigned » minnur
Status: Active » Needs review
Liliplanet’s picture

Status: Needs review » Reviewed & tested by the community

perfect, thank you! users can now see their ad ..

minnur’s picture

added to dev.

Nor4a’s picture

Version: 7.x-1.8 » 7.x-2.x-dev

The same issue with 2x.
Now the problem is in the includes/node.inc file - in the "simpleads_node_access" function. Incorrect permission naming.

Change the line:

if (isset($node->type) && $node->type == 'simpleads' && $op == 'view' && !user_access('access ad node', $account)) {

To the line:
if (isset ($node->type) && $node->type == 'simpleads' && $op == 'view' && !user_access('access advertisement node', $account)) {

yvesvanlaer’s picture

Issue summary: View changes
FileSize
578 bytes

I created a patch for this. I think It is about time that this will be committed :).

minnur’s picture

Status: Reviewed & tested by the community » Closed (fixed)

Fixed in DEV.

Status: Closed (fixed) » Needs review

Status: Needs review » Needs work

The last submitted patch, 7: permission-issue-1795174-2.patch, failed testing.

minnur’s picture

Status: Needs work » Closed (won't fix)