Hiding "sufficient access level" Stack Trace messages

Post

Posted
Rating:
#7456 (In Topic #2133)
Avatar
Standard member
friendly is in the usergroup ‘Community saint’

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.


Art and Imagination
of David L Friend

http://davidlfriend.com

  My Business Art Gallery
powered by ocPortal
Online now: No Back to the top

Post

Posted
Rating:
#7458
Avatar
Site director
Chris Graham is in the usergroup ‘Administrators’
Hi,

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).


Become a fan of Composr on Facebook or add me as a friend. Add me on on Mastodon. Follow me on Minds (where I am most active). Support me on Patreon

Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about Composr whenever you see the opportunity or support me on Patreon.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying Composr on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Online now: No Back to the top

Post

Posted
Rating:
#7460
Avatar
Standard member
friendly is in the usergroup ‘Community saint’
OK, I got that. Thanks Chris!

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?


Art and Imagination
of David L Friend

http://davidlfriend.com

  My Business Art Gallery
powered by ocPortal
Online now: No Back to the top

Post

Posted
Rating:
#7461
Avatar
Site director
Chris Graham is in the usergroup ‘Administrators’
This should work:
{$?,{$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.


Become a fan of Composr on Facebook or add me as a friend. Add me on on Mastodon. Follow me on Minds (where I am most active). Support me on Patreon

Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about Composr whenever you see the opportunity or support me on Patreon.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying Composr on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Online now: No Back to the top
1 guest and 0 members have just viewed this.

Statistics

Forum statistics:
  • 2,053 topics, 7,195 posts, 10,839 members
  • Our newest member is PurplewaveIndia
Birthdays:
Back to Top