Jump to content

[SOLVED] Roles allowed for custom admin pages


ngrmm
 Share

Recommended Posts

How do I restrict viewing custom admin pages.

I followed this tutorial and added a new page. It's also visible in the header in the backend.
This is my code and I also created the permission and added to a role.
As superuser I'm able to view this custom admin page, but as non-superuser with the permission eventbrite-import you don't see it in the backend header menu

<?php namespace ProcessWire;

class EventBriteImport extends Process {

	public static function getModuleinfo() {
		return [
			'title' => 'Eventbrite',
			'summary' => 'Triggers eventbrite import and display an overview',
			'author' => 'me',
			'version' => '0.1',
			'permission' => 'eventbrite-import',
			'page' => [
				'name' => 'eventbrite',
				'title' => 'Eventbrite',
			],
		];
	}
  
  

 

Link to comment
Share on other sites

  • 4 weeks later...
On 4/25/2025 at 6:08 PM, ngrmm said:

but as non-superuser with the permission eventbrite-import you don't see it in the backend header menu

Maybe it's a caching issue. The navbar in the backend has unfortunately very aggressive caching built in, so you need to either log out and log back in or you use tracydebugger:

xg7USad.png

  • Like 1
Link to comment
Share on other sites

  • ngrmm changed the title to [SOLVED] Roles allowed for custom admin pages

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...