Hiding "sufficient access level" Stack Trace messages
Posted
#6555
(In Topic #1470)
How do I keep Stack Trace messages from showing up on members pages
The Reported Posts Forum shows up on the main menu and I'm not sure I want to delete it off the menu but there is no reason that any member usergroup needs to see it except the admin and Super Moderators.When a member selects from the menu 'Reported Posts Forum' it takes them to a page that says:
You have permission to see a stack trace for this condition. This error message probably does not indicate a system fault, which is why the stack trace was not shown automatically; however if it is a fault, stack traces help programmers identify the cause of a problem and thus are great for bug report.
...also on the page is displayed the message - “test” does not have a sufficient access level for this category. (I'm using test as the member.)
What can I do to eliminate the member from seeing the menu for the Reported Posts Forum? I know I can delete the menu but I'd like for the Admin and Super Moderator to be able to be able to use it.
Posted
Regarding the stack trace…
Normally members will not see the stack trace message/link. They may in these circumstances:
- If you are testing another account using the SU feature
- If you enabled dev_mode in _config.php
- If you have a .git directory and did not disable dev_mode in _config.php
- If you assigned the "See stack dumps" privilege widely
Regarding the menu link…
The menu code cannot check category permissions, only zone and page permissions. So a permissions check won't be possible.
There is a fudge though…
In the menu editor, for the link, expand the Advanced options, and in "Restrict link visibility" put {$?,{$NOT,{$IS_ADMIN}},_never_}
Anyone curious, it says if you're not an admin then only show the link if the user is viewing from a zone named _never_ (i.e. it'll never happen).
Posted
and if I wanted to give access to more than just Admin, say also to Super-moderators, is there a way to include more than one Usergroup?
Posted
{$?,{$NOT,{$IS_STAFF}_never_}
Or if you want to be more explicit:
{$?,{$NOT,{$IS_IN_GROUP,2,3}_never_}
I'm assuming #2 is admin and #3 is supermods here.
3 guests and 0 members have recently viewed this.