inherit
264279
0
Feb 5, 2024 17:01:15 GMT -8
shawnatdgk
59
May 2021
shawnatdgk
|
Post by shawnatdgk on Jun 28, 2023 9:03:24 GMT -8
So I'm building a plugin, it adds a button to a page on the forum that works all of the magic from there. I want to hide the button from anybody who isn't staff and give the plugin admin the option to choose which group or groups can edit the plugin. What the button does is essentially lead the user back to the plugin to edit some settings.
So, in order to find out which group the user is in and check if their name is in one of the allowed groups, would I:
find a page that lists the groups and their names and scrub that html for the info and then check if the users name matches one in the list?
Not sure the simple way to go about this. Thanks
|
|
#e61919
Support Staff
224482
0
1
Nov 22, 2024 17:59:24 GMT -8
Scott
“Asking for help isn't giving up... it's refusing to give up.”
24,521
August 2015
socalso
|
Post by Scott on Jun 28, 2023 13:45:46 GMT -8
shawnatdgk - When you say: "lead the user back to the plugin to edit some settings" do you mean accessing the plugin's options in the admin panel? If so, this can only be done if the member is part of a group that has that permission enabled. Note however, that this gives the member power to edit all plugins as well as the headers/footers of the forum. You can't have a script that overrides the built-in powers that controls who can access the admin panel and the different sections. But now as far as using the plugin (or "seeing the button") there is already a permission setting built in for plugins. Go to Admin > Plugins > Manage and to the right of a plugin's name click the Edit button. The first option is who can view (see and utilize) the plugin. From the dropdown select Staff and use the option for And members in the groups: to specify which group(s) can view. If your plugin's settings are made available client-side, then this should work for you.
|
|