Jump to content

Module permissions for admin templates


Jonathan Claeys
 Share

Recommended Posts

I wrote 2 modules for internal use, static translations & site settings. But I can't seem to get them visible in the admin for my "client" role. 

public static function getModuleInfo(){
  return array(
    "title" => "Settings Module",
    "version" => 100,
    "summary" => "Site wide settings module",
    "permission" => "edit-settings", 
    "permissions" => array(
    	"edit-settings" => "Edit settings"
    ), 
  );
}

This is what I've got in my module, I also added those permissions to my role in the backend. But still the tabs aren't appearing to my client. When I try to surf to the URL, it just redirects me to the pagetree, so I guess for some reason permissions are still not set? Did I overlook something?

Link to comment
Share on other sites

  • 1 year later...
On 11/10/2016 at 10:15 AM, Jonathan Claeys said:

After multiple refreshes, a new update: I can surf to the URL right now, but the tabs won't show up in the admin navigation, they are only visible for the superuser there.

If "tab" means "main menu item" then I have the same issue. The user has access to the custom page attached to a process module but the menu item shows up for the superuser only. I've refreshed the modules a lot to no avail.

Note that PW did not create the permission either like discussed here:

https://processwire.com/talk/topic/276-creating-new-admin-page/?do=findComment&comment=1856

"In 2.1, PW doesn't install a permission and access to the Process is assumed if user has access to the page it's on. If you want PW 2.1 to behave like PW 2.0 and require a specific permission before it'll run the module, you want to specify it in your getModuleInfo function:"

I had to create the permission manually.

What else I'm missing? I'm stuck... :(

 

Link to comment
Share on other sites

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

×
×
  • Create New...