Log in

View Full Version : Permissions Page


RobDog888
02-09-2008, 07:56 PM
I need to create some permissions but I dont want them shown in the usergroup permissions admin page. I'd rather have them shown in a custom admincp page for my product. I've read through kirbys article on permissions but that just adds to the vbulletin usergroup permissions.

I have the admincp pages created already and just need to figure out how to finish this off.

I'm looking to create something like...

"Can use myproduct? Yes/No?"
"Can do something? Yes/No?"
"Can do somethingelse? Yes/No?"

And have that in my custom admincp page only. If I have to have it in both my page and the usergroup settings page then I guewss that may be ok but I'd rather not.


Thanks

Opserty
02-09-2008, 09:22 PM
You have to use a different group name for the bitfield I think. I haven't done it myself before but I think if you use some other group name like 'thename' then you can access the fields through $vbulletin->bf_thename['somebitfield']. Then cycle through them or w/e you need to.

RobDog888
02-09-2008, 11:21 PM
<font color="darkgreen">Thanks I'll test it out on my test site and post back.</font>

RobDog888
02-17-2008, 07:43 PM
Hmm, I got the default user group permissions to show but they are in the user group page of vb. I want to move them to my own admincp page I already have setup.

I just need the backend code for the settings and options to utilize vb's features for these. Doesnt seem necessary to reinvent the wheel, only rotate it. :)

So instead of having user group permissions appear on the ug page I want it on my page and yet still be accessible via code like ...

$vbulletin->bf_ugp_myproductpermissions['candosomething'])

I have searched the documentation and sites for information but everything is out of date.

Opserty
02-17-2008, 08:18 PM
If they are usergroup settings though, they should be listed under usergroup management. Why are you so adamant that they shouldn't be on the usergroup page, you cause more confusion to the end user by moving around permissions from this page to that page. I would prefer to edit all usergroup settings on the Edit Usergroup page. If you must then you can always duplicate the usergroup permissions for your modification on your own AdminCP page.

I think the "Edit Usergroup" page will drag everything up which is on a "Per Usergroup" basis. You could stick it in the 'misc' group or something like that. You don't need to rotate the wheel...just duplicate the little section of the wheel that you need and stick it on to your page. Although seeing as then you have to engineer all the code to display & process this it seems a bit odd when vB will do it for you! But whatever floats your boat as they say. ;)

RobDog888
02-17-2008, 11:05 PM
True and I did think about the confusion but my product has alot of settings and permissions that I added a specific nav group. I probably will let the ugp take care of those perms but the settings and options would be much better off separated out like vBAdvanced does.

This is the closest I have found on settings/options...
https://vborg.vbsupport.ru/showthread.php?t=116155

Any idea how to generate them? I tried ...

<?xml version="1.0" encoding="ISO-8859-1"?>
<bitfields product="myproduct">
<bitfielddefs>
<group name="ugp">
<group name="myproduct_permissions">
<bitfield name="can_view" group="myproduct_permissions" phrase="myproduct_can_view">1</bitfield>
<bitfield name="can_play" group="myproduct_permissions" phrase="myproduct_can_play">2</bitfield>
<bitfield name="can_upload" group="myproduct_permissions" phrase="myproduct_can_upload">4</bitfield>
<bitfield name="can_edit" group="myproduct_permissions" phrase="myproduct_can_edit">8</bitfield>
</group>
</group>
<group name="myproduct">
<group name="mysetting1">
<bitfield name="mysetting1"></bitfield>
<datatype>free</datatype>
<defaultvalue></defaultvalue>
</group>
</group>
</bitfielddefs>
</bitfields>
And I figure there is more to it then that for the settings/options but that article is old so I dont think its done that way anymore.

Opserty
02-18-2008, 07:59 AM
And I figure there is more to it then that for the settings/options but that article is old so I dont think its done that way anymore.
You mean board wide settings? or per user settings?

Board wide settings can be added simple by running the AdminCP in Debug mode and entering vBulletin Options, you then need to find the link to add a Settings Group (associate this with your product) then enter the empty settings group you have just created and You should find a link with say "Add Option" or something along those lines.

If its on a per user basis than that article is fine, I think.

RobDog888
02-18-2008, 03:32 PM
<font color="darkgreen">Yes, some are going to be system wide settings. Thanks.

Why isnt this info in the documentation?</font>

Opserty
02-18-2008, 04:30 PM
It is most likely considered as editing the vBulletin code...therefore you won't receive any official support. So there is no need to stick it in the documentation (from Jeslofts point of view). Plus its pretty obvious (if your in debug mode) that you can add extra options, I discovered just messing around with a test board. :p

RobDog888
02-18-2008, 05:08 PM
Well I guess that would explain it as I havent ever run debug mode.
Just setup a test board and turned debug on. Doh! Its all there. :o

Thanks

I take it that I dont specify it as a vb default setting group?

Opserty
02-18-2008, 05:15 PM
I don't know actually, I just guess and set it to No (or sometimes randomly Yes, depending on my mood) not sure how much difference it makes. Wait till someone else replies they might be able to shed some light on it. ;)

RobDog888
02-18-2008, 05:41 PM
<font color="darkgreen">I think it looks like it should be set to No as my settings are separate from vB.

This is cool but it adds to the vbulletin settings dropdown. i just want to create/use my own settings and display thenm in my own admincp page. Hmm, maybe I just shouldnt use the vb setting table but then it wont be cached like all the other settings and that will require another db call and code etc.

When I export what I have (setting group and one setting) nothing but the settinggroup appears in the xml file.</font>

Opserty
02-18-2008, 06:47 PM
Make sure the individual settings are associated with the product as well and also make sure that "Blacklist" is set to "No" for each setting.

Nullifi3d
02-19-2008, 08:07 AM
For setting groups (not ugp):
<options>
<settinggroup name="productpermissions" displayorder="0">
<setting varname="productpermissions_settingname" displayorder="1">
<datatype>free</datatype>
<optioncode>yesno</optioncode>
<defaultvalue>1</defaultvalue>
</setting>
</settingroup>
</options>displayorder="0" will hide the setting group from view in the vbulletin options setting groups display (unless debug mode is turned on).

For display of settings at the bottom of the ACP's links (cpnav_product.xml):
<?xml version="1.0" encoding="ISO-8859-1"?>
<navgroups product="yourproduct" master="true">
<navgroup phrase="yourproduct_options" permissions="canadminsettings" hr="true" displayorder="10">
<navoption displayorder="10">
<phrase>vbulletin_options</phrase>
<link>options.php?null=0</link>
</navoption>
</navgroup>
</navgroups>
For display of settings at the top of the ACP's links (admin_index_navigation plugin):
if ($yourcondition) {
construct_nav_option($vbphrase['productpermissionsphrase'], '../' . $vbulletin->config[Misc][admincpdir] . '/options.php?dogroup=productpermissions');
construct_nav_group($vbphrase['productsettings']);
construct_nav_spacer();
}

RobDog888
02-19-2008, 08:23 AM
Thanks for the code Nullifi3d. I have the admin nav group navigation menu and pages already done but the option/settings is what I mainly needed. :)


But where is the "admin_index_navigation plugin" yor talking about? Is that in place of using the cpnav_product.xml which I am using?
Btw, does anyone know how to import the help topics created in debug mode? I tried and it looks correct but they wont show on my test board. Seems like I need to insert a record or two into the adminhelp table?