MyBB Community Forums

Full Version: Restrict plugin usare to specific groups
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I would like to restrict the usage of certain plugins just to some groups, this means that whatever is related to a restricted plugin has not to be displayed if user doesn't belong to the specific group(s) allowed to use it.

Is this possible?
Also, how may i hide a certain html code from header's template, making it invisible to guests?
For hiding content in the header you can place the code that will be hidden from guests in the header_welcomeblock_member template.
I've tryed but with the theme i'm using header's left side is available to guests while right one displays member's info. To give the code much visibility (it's the MyAlert button) i want to have it on the left, isoated from everything else, but keep it hidden until login.

I've tryed all the html code i know to do this in the welcomeblock_member template but without success, it always appears on the right side.

By the way what i really need is to be able to hide certain plugins for specified usergroups, is this possible?
For the plugins, you will need to add that functionality to each individual plugin that you want that option for. Since all plugins are different, there is no way to universally say that if you're in one of these usergroups, don't use a plugin.

To accomplish this, I would recommend making a custom configuration setting, called something like "hide_plugin_usergroups". Then include some kind of if/else statement in your individual plugin files to check if the user is in that group. If not, do the plugin stuff.

if (!in_array($mybb->user['usergroup'], $mybb->settings['hide_plugin_usergroups'])) {
plugin stuff
}

That's about as specific of advice I can give without knowing which plugins you don't want to certain usergroups to access.
(2014-09-17, 04:39 PM)jshort Wrote: [ -> ]For the plugins, you will need to add that functionality to each individual plugin that you want that option for. Since all plugins are different, there is no way to universally say that if you're in one of these usergroups, don't use a plugin.

To accomplish this, I would recommend making a custom configuration setting, called something like "hide_plugin_usergroups". Then include some kind of if/else statement in your individual plugin files to check if the user is in that group. If not, do the plugin stuff.


if (!in_array($mybb->user['usergroup'], $mybb->settings['hide_plugin_usergroups'])) {
plugin stuff
}

That's about as specific of advice I can give without knowing which plugins you don't want to certain usergroups to access.

Thank you very much, i appreciate your support even if this has been solved by using the plugin MyPermissions, it allowed me to do it in minutes Smile

This thread can be closed.