Closed (fixed)
Project:
Quiz
Version:
7.x-4.x-dev
Component:
Code - other
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
20 Feb 2012 at 13:51 UTC
Updated:
22 Jun 2014 at 16:17 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
sivaji_ganesh_jojodae commentedThanks amagdy. Commit 8424db5..2fe6ff8 should fix this. By
hook_node_access()definition $node can be a node object or the machine name of the content type. Added$type = is_string($node) ? $node : $node->type;check to fix this.Comment #2
amagdy commentedi learned something new from your replay, Thanks
your fix is great, but i got the permission denied again, tracing it i found that we use permissions that doesn't exist, may be it was changed from d6 and d7
'create quiz' => 'create quiz content'
'edit any quiz' => 'edit any quiz content'
Comment #3
sivaji_ganesh_jojodae commentedamagdy, I had some tough time as well with node permission testing i.e I got permission denied in unexpected cases where I expected to see grants. Later I figured it was registry cache problem. hook_node_access() outputs are cached it seems. Are you sure you cleared the registry before testing? [I did it with
drush cc registrycommand]Also the new permissions like 'create quiz content', 'edit any quiz content', etc. are inherited automatically from node module and check for the same is likely to happen in node module. Perhaps our checks are obsolete now. Simpletest is the smart way to test this. I will see if can write some code for this.
Comment #4
amagdy commentedI checked how permissions are written in database, there was a table 'role_perm' i guess, not on my dev machine
in this table the permission was used as i did in my latest patch
Comment #5
sarjeet.singh commentedI faced same issue.
is submited this patch in 7.x.4.x-dev version?
Comment #6
sarjeet.singh commentedpatch #2 is working fine.
thanks @amagdy
Comment #6.0
amagdy commentedfix is obsolete, we should use the next patch
Comment #7
freddura commentedI have experienced the same issue...
I am getting the following errors when trying to apply patch #2 to the latest dev release:
error: patch failed: question_types/quiz_question/quiz_question.module:94
error: question_types/quiz_question/quiz_question.module: patch does not apply
any ideas?
Comment #8
amagdy commentedWell, Quiz 7.4 is changing rapidly..
Patch #2 doesn't apply because the code was update since my last patch, unfortunately I can't produce a new patch now
I checked the code, and my guess is that,the bug lies in lines (104 & 108) in
($account->uid == $node->uid)By
hook_node_access()definition$nodecan be a node object or the machine name of the content type.Comment #9
luciogodoy commentedHi All,
I have a drupal 7 website, and i have downloaded quiz 7.x-4.x-dev and i m having issues when creating questions, i am getting permission denied, could you guys share some light on this issue pls?
Thanks
Lucio
Comment #10
falcon commentedamagdys changes have been commited. Thanks!
Comment #11
sarjeet.singh commentedthanks @falcon
Comment #12.0
(not verified) commentedfixing typo