MyBB Community Forums

Full Version: Module Permissions
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

I'm creating a custom module (I can't release any details about it), and I can't seem to get the admin permissions working.

This is in my module_meta.php file, but it's still not working. I can get set the permissions, and it won't display the tab, but I'm still able to manually type of the url module and view it.

function modulename_admin_permissions()
{
	global $lang, $plugins;

	$admin_permissions = array(
		"main" => "Can manage [module_name]"
	);

	$plugins->run_hooks_by_ref("admin_modulename_permissions", $admin_permissions);

	return array("name" => "Module Name", "permissions" => $admin_permissions, "disporder" => 60);
}

What do I need to do so when I visit the module url, it will give me the admin permission error if I set the permissions to not being able to view the module?

Thanks.
It's better to add a 'module' directly through the plugin file itself, not through an extra file. So it's also easier to add admin permission.

Have a look at Page Manager plugin: http://mods.mybb.com/view/page-manager

The 'module', a link to it in navigation and admin permission setting are added just with the plugin file.