Drupal Access Denied but Permission are Correct
Ran across this one today. Upgrading a site with some custom work from 4.7 to 5.6. Obviously the testing of the upgrade is going on is a development environment but we ran into a problem with anonymous users being denied access.
Well, a quick check of the access control records proved that anonymous users did in fact have the Access Content permission. Hmmmm…. what else could it be.
As a side note, originally on pages where the user was denied access all you got in the content body was a “2”. No access denied message, just the numeral “2”. Thanks to the good folks on irc #drupal-support it was found this this is typical of an access denied issue. Atleast that led us down the right path.
Long story short, the tac_lite module had been previously installed on this site but was no longer being used. Apparently the disabling of the module did not properly clean up the node access data.
Again, thanks to the great folks on #irc, this time BDragon, and a quick search on drupal.org, the solution was easy. The default access row was missing. Adding the following to the table resolved the issue:
INSERT INTO node_access VALUES (0, 0, 'all', 1, 0, 0);
Yeah Drupal community! Yet another great reason to love Drupal.

Comments
Need help with access denied
I am using views.
When creating a VIEW in the ACCESS part of VIEW i set it to access a role called STUDENT
But when i login as a STUDENT - it says access denied - you are not authorised to view this page - when i try to goto to the view pagelink
But when i goto Home » Administer » User management >> Access Control
and under “views module >> access all views” if i check it ON for STUDENT then i can see the page
Obviously i do not want the user STUDENT to see all the pages, except for teacher notes specific to them.
Funny part is i did not get this error yesterday.
So something i have done today - can you help me! (can’t figure out what has changes - except for that iinstalled two new modules nodefamily & view_fusion
ratnesh
I am using views.
When creating a VIEW in the ACCESS part of VIEW i set it to access a role called STUDENT
But when i login as a STUDENT - it says access denied - you are not authorised to view this page - when i try to goto to the view pagelink
But when i goto Home » Administer » User management >> Access Control
and under “views module >> access all views” if i check it ON for STUDENT then i can see the page
Obviously i do not want the user STUDENT to see all the pages, except for teacher notes specific to them.
Funny part is i did not get this error yesterday.
So something i have done today - can you help me! (can’t figure out what has changes - except for that iinstalled two new modules nodefamily & view_fusion
ratnesh
I LOVE YOU!!!
You just saved me from going freaking crazy!!!
You just saved me from going freaking crazy!!!
Glad It Helped
Haha…Excellent. Glad it helped at least one person. Now, that post was worth it. ;)
Blessings
Haha…Excellent. Glad it helped at least one person. Now, that post was worth it. ;)
Blessings
Another happy person
Thanks
Thanks
Make it Four Happy People
I was dealing with this for a couple weeks after I tried out some permission based modules. It was driving me bonkers! Thanks for the tip :)
I was dealing with this for a couple weeks after I tried out some permission based modules. It was driving me bonkers! Thanks for the tip :)
Great!!!
Make that two happy persons!! Well done putting this down for us. Thank you!!
Make that two happy persons!! Well done putting this down for us. Thank you!!
HAPPY DANCE!
Thank you! Thank you! Thank you! This saved me a lot of time.
Thank you! Thank you! Thank you! This saved me a lot of time.