PDA

View Full Version : Navigation Permissions?


I.G.O.T.A.
04-29-2019, 07:23 PM
What is the easiest way to set one specific group to view a tab on the navigation bar?

When I add the group in the (Show Permission Name) it doesn't work.

Any ideas?

Thank you,
JJ Smith

MarkFL
04-29-2019, 09:39 PM
If you want specific usergroups only to see a navbar tab, then create a plugin hooked at "gloabl_bootstrap_init_complete" with code like this:

global $vbulletin;
$show['mynavtab'] = false;

if (is_member_of($vbulletin->userinfo, array(groupid1, groupid2, ...)))
{
$show['mynavtab'] = true;
}


Where I have "groupid1, groupid2, ..." you want to put the comma delimited list of usergroups by id that you want to have access to the tab.

And then in the Navigation Manager, in the field labeled "Show Permission Name" put:

mynavtab

You should use your own name for "mynavtab" that indicates the nature of the tab. Make sure they are the same in the plugin and in the Navigation Manager.

I.G.O.T.A.
04-29-2019, 10:23 PM
If you want specific usergroups only to see a navbar tab, then create a plugin hooked at "gloabl_bootstrap_init_complete" with code like this:

global $vbulletin;
$show['mynavtab'] = false;

if (is_member_of($vbulletin->userinfo, array(groupid1, groupid2, ...)))
{
$show['mynavtab'] = true;
}


Where I have "groupid1, groupid2, ..." you want to put the comma delimited list of usergroups by id that you want to have access to the tab.

And then in the Navigation Manager, in the field labeled "Show Permission Name" put:

mynavtab

You should use your own name for "mynavtab" that indicates the nature of the tab. Make sure they are the same in the plugin and in the Navigation Manager.

Awesome!

Thank you,
JJ Smith