The My results tab shows when the user has no access, but it does tell them so after they click it. The attached patch removes it when they don't have access, which is cleaner.

I'm filing this as a bug report, because the way you're supposed to indicate permissions to view a menu item is through the 'access callback' and/or 'access arguments' values when adding it through hook_menu(). The way Quiz does it for that tab is way off. Anyone who can view their own results is allowed to see that tab, no matter what user the tab actually belongs to.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Netbuddy’s picture

Anyone tested this patch? Think i might have to give it a whirl, but im using Quiz 6.4 dev. This tab is still a problem.

falcon’s picture

Thanks for the report!
I'll create a pointer to this issue in the 4.x-dev issue list as well. I only work on Quiz 4.

falcon’s picture

FileSize
3.04 KB

Thanks!
I have had a look at this patch, and it will be commited to 4.x-dev.

I also cleaned up the quiz_get_user_results function.

Patch for both is attached.

Sivaji_Ganesh_Jojodae’s picture

Status: Needs review » Postponed (maintainer needs more info)

The My results tab shows when the user has no access

I tried this several times but i am not able to reproduce the same behavior here. I can't view the My results tab, unless view own results permission is granted.

falcon’s picture

I think I was able to reproduce it when viewing other users profiles.

1. Log in as a user with "view own results" permission and not "view user results".
2. View someone elses profile(you should se the "My results" tab)
3. Click the "My Results" tab(You should get a custom access denied message)

darktygur-1’s picture

I just looked at the currently available versions of Quiz. Version 4.0-beta2 is fixed. Versions 3.4 and 3.x-dev both don't have it. Since I originally reported this against 3.x, I'm surprised that 4.x is the only version with the fix.

Sivaji, could you have been testing with a 4.x version?

falcon’s picture

Issue tags: +toBeClosed, +FixedIn4

Adding tags. This issue will be closed when quiz 4 RC is released.

falcon’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)