Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi,
I made a custom module to add the feature that quiz owner can allow other users to edit or view the results of their quiz.
I have a function quiz_permission_user_is_analyst($user,$node) which returns me a Boolean regarding if the user has the appropriate role.
I have tried to modify the view permissions of the "quiz" tab at /node/%/quiz/ but i cannot find where in the code i can make the change.
Can you help me
Thanks
Comments
Comment #1
djdevinHi,
You are talking about two permissions - the ability to edit the node (Quiz), and then the ability to edit/view results?
Editing the node you can do with node access. The Quiz results page is a view, so you should be able to edit it and change the permissions for it.
Let me know if that helps
Comment #2
gspfranc CreditAttribution: gspfranc commentedActually, in the quiz_results.view.inc, on line 155, only users with "update" permission can view the result list.
Is there a way to modify this line to add an access_callback function like on menu item for displaying this tab?
thanks
Comment #3
djdevinSee https://www.drupal.org/node/2666834#comment-10865972