PDA

View Full Version : HowTo Create Custom Usergroup Permissions


Andreas
10 Jun 2005, 17:58
Usergoup Permissions are being controlled through XML files, you don't have to edit usergroup.php anymore

To create your own usergroup permissions, the first thing to do is to modify table usergroup (keep table prefixes in mind!):



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



If your hack does need some integer settings as well (and not just On/Off-Options):



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



Then you must create a an XML-File bitfield_myhack.xml and place it in includes/xml:



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



As you can see, you must create a new permission group below group ugp (short for usergroup permissions).

Parameter product of Tag bitfields should be the identifier of your Product (http://www.vbulletin.org/forum/showthread.php?t=92953)

Paramater name of Tag group must match the column name in table usergroup.

The Parameters for Tag bitfield are:


name is the identifier you can use in your hack code (eg. $permissions['myhackpermissions'] & $vbulletin->bf_ugp['myhackpermissions']['canfoo'])
In case of integer options this name must match the column name in table usergroup.
intperm indicates that this Option is a integer value
group is the varname for the Phrase that should be displayed as Permission Group Title.
This is also being used to set up different Groups for your permissions.
phrase is the varname of the Phrase that should be displayed for this option in Usergroup Manager
install is a comma-separated list of the usergroups where this permission should be visible
If this parameter is empty or omitted, this Option will be used for all Usergroups


The value of <bitfield> is the decimal value of the bit (eg. 1 for the first, 2 for the second, 4 for the third, and so on).
In case of an Integer Option this is the default value.

If you want to hide certain permission groups for some usergroups, for example from Guests as they don't make sense for them:



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



Parameter name is the name of the permission group you want to hide, ignoregroups is a comma seperated list of usergoup IDs where this permission group should not show up.
Place this section below the <bitfielddefs>-Section.

Now create the necessary phrases (in Phrasegroup Permissions) at this point.

As vBulletin caches Bitfields in Datastore, you must rebuild this cache before the new usergroup permissions can be actually used (They will already show up in Usergroup Manager, but cannot be saved - you will get an error).
To do so, point your browser to admincp/index.php?do=buildbitfields.

You can also use the following Code (in a Custom Installer or Install-Code of a Product (http://www.vbulletin.org/forum/showthread.php?t=92953)) to update the Bitfield Cache:


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



If you install/upgrade vBulletin and custom bitfield_xxx.xml files are already in place, they will be used - you don't have to update the Bitfield Cache in this case.

This How-To is (C) 2005 by KirbyDE and you are not allowed to redistribute it in any way without my explicit consent.

noppid
10 Jun 2005, 20:04
Very nice, no more chances of stepping on toes. :)

I think the field add for a custom permission, bitfield, may need to look like this instead...



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------

Revan
10 Jun 2005, 20:14
Good tut, I hope Administrator Permissions is next... *hint* ;)

Andreas
10 Jun 2005, 20:41
@noppid
Right. Should have been UNSIGNED of course, corrected :)

deathemperor
11 Jun 2005, 03:57
very very nice, this will boost the learning of vb3.5, no one wrote something like this for vb3.0

Danny.VBT
11 Jun 2005, 04:03
Yay! This is what I was going to ask for! :up: :up:

burnist
11 Jun 2005, 10:36
I think I love you KirbyDE :)

amykhar
12 Jun 2005, 04:02
Question: Is there something similar for forum permissions?

Shaved
13 Jun 2005, 13:06
Im with amykhar I tried to apply this to forumperms but with no effect.

I want simple yes/no option. I even tried editing the bitfield_vbulletin.xml directly and no effect any help appreciated.

*edit *

Got it to work.

Note to self read full post before asking for help

Andreas
16 Jun 2005, 18:15
Update: Simplified instructions to rebuild Bitfield Cache.

@amykhar
You can extend the forumpermissions bitfield, however I fear this will cause problems sooner or later - 20 of 32 Bits are already being used.

To do so:



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------

Ron1n
18 Jun 2005, 02:24
Why cant this be added to bitfield_vbulletin.xml? I have tried, but it doesnt work.

Andreas
18 Jun 2005, 02:29
It can ... but you shouldn't do that, as bitfield_vbulletin.xml will be overwritten during an upgrade, which means you would have to redo the changes.
If you use your own XML file it will still be there and used after an upgrade.

Ron1n
19 Jun 2005, 00:49
how does one go about putting a title on the grey table header? I tried phrase="_phrase_var_" and text="phrase text" but neither worked.

Andreas
19 Jun 2005, 01:43
Quoting myself to answer your question:


The Parameters for Tag bitfield are:


group is the varname for the Phrase that should be displayed as Permission Group Title.
This is also being used to set up different Groups for your permissions.

Ron1n
19 Jun 2005, 04:05
yea, i read that but figured I also needed another param because it wasnt (and isnt) working



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



download_permissions is a phrase that says Download Permissions

I'll try looking over everything to see if there are errors, but I dont see how I could have messed up.

merk
20 Jun 2005, 06:42
Have you tried phrase="download_permissions" instead of name=?

Chris M
20 Jun 2005, 16:27
Kirby - Any way to make this work with Forum Options? :)

Rather than editing forum.php ;)

Satan

deathemperor
21 Jun 2005, 17:40
there're optional ways to use the permission:

along with

$permissions['myhackpermissions'] & $vbulletin->bf_ugp['myhackpermissions']['canfoo']

you can use

$permissions['myhackpermissions'] & $vbulletin->bf_ugp_myhackpermissions['canfoo']

or

$permissions['myhackpermissions'] & 1

the last one is the shortest one but then you won't understand what it does, 1 is the value of <bitfield> tag, just similar as the old permission settings.

I found that the 'canfoo' is case sensitive, this took me almost a day to figure out lol

HakkieDEV
25 Jun 2005, 11:05
I still don't understand how I could add forumpermissions?

I've tried to play with it, I've added an xml file with the content of kirbyDE, but it didn't work.

Andreas
25 Jun 2005, 12:25
Take a look at my recent Get New Posts Hack and you'll see :)

HakkieDEV
25 Jun 2005, 13:33
I've had a look and I see that it also adds a field in the usergroup permissions area.

However, I'd like to know how I could add some extra permission fields in the forum area (admincp/forum.php).

Andreas
25 Jun 2005, 21:39
Not possible without editing the File.

HakkieDEV
26 Jun 2005, 08:13
Ah, okay, thanks.

It was driving me crazy. :)

TitanKing
12 Jul 2005, 09:11
Can anyone please explain to me the forumpermissions bits, how will I get the permissions out of there... thank you...

MrNase
27 Jul 2005, 19:06
Here's my bitfield_vbgarage.xml and here's the error I get once my custom permissions are in place:




Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------




If the file is there and active I get this error when I try to save the permissions. The newly added permissions are not saved and they remain 'no'..

Andreas
27 Jul 2005, 19:27
Make sure you don't have any Plugins enabled and try again.

Edit: install="" might also cause this error

MrNase
27 Jul 2005, 19:33
It's a fresh install without any plugins.. I also removed install="" with no success :(

I added another group and here's the sql error I get now:



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



You can see that canvbgarage is empty but it shouldn't..

I edited the usergroup #6 via phpmyadmin and changed canvbgarage to 1 and the usergroup manager still says no and my scripts are still not working :(

Andreas
27 Jul 2005, 19:41
Did you rebuild the Bitfield Cache?

Btw:

I'd use a XML like


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------

MrNase
27 Jul 2005, 19:47
Verdammt, ich wusste doch das ich was vergessen hatte *vordenkopfschlag* :D

No I didn't :D

Next question: If Iam using the XML like you suggested, what does this has to look like:


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------

Andreas
27 Jul 2005, 19:54
Well, it's just variable Names so it's not really important, but IMHO it makes Code more readable :)



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------

Brinnie
29 Jul 2005, 22:08
very nice,

thank you! :D

Mr Blunt
21 Aug 2005, 06:50
KirbyDE .... Great How-To!!

One thing I would like to point out to everyone which I think is extremely relevant to this thread is the install="X" field will not be recognized during a product installation script ... at least not without extra code which I haven't figured out how to write yet. Simply rebuilding the bitfields (while it will allow the new permissions to begin functioning) will result in all zero's as default for all groups.

http://www.vbulletin.com/forum/bugs35.php?do=view&bugid=1054

This is the vBulletin response.

This is happening because the install field in the bitfield XML is only used when vBulletin is first installed (see lines 2280-2315 in install/mysql_schema.php). You may want to reproduce some of the code from there in your plugin to get it to take up the default values.
I played with this all day today and basically got nowhere.
Maybe someone else will have better luck than me.

Andreas
23 Aug 2005, 14:57
Untested, but



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------

Mr Blunt
23 Aug 2005, 19:55
You were close Kirby
You only forgot the WHERE usergroupid=$usergroupid in the query.
Works like a charm!!!
Thank you, Sir!!



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------

Andreas
23 Aug 2005, 19:58
I knew there was a reason why I specified a Variable for the Key in foreach() :p

Kirk Y
23 Aug 2005, 21:36
lol... Kirby, might I ask why I'm in your signature?

Andreas
23 Aug 2005, 21:43
Yes. I've read this Post you made and found it very amusing :)

Mr Blunt
23 Aug 2005, 22:16
Can anyone verify or deny for certain if two of the same "canfoo" bitfield names can exist as long as they are each under a different groupname?

For example, something like "canview" under groupname "bluntswhodlpermissions".

I could see almost every hack using a "canview", LOL, but the groupname is very unique.


I ask because I do see a lot of vbulletin code which checks for clashes, but the code gets a little too deep for me to fully understand so far.

I ask in this thread to help reinforce this how-to. I mean if we must all diversify this variable as well, then maybe the how-to should reflect that we should put part of our myhack name in this too somehow .... or maybe we are all good with real simple short vars here if duplicate canfoo's are ok as long as the groupname is unique. I suspect the latter, but I leave it as a question.

Just trying to help avert potential problems down the road while we are all learning the vb350 ways.

Andreas
23 Aug 2005, 22:21
You can have "canfoo" in myperms1, myperms2, mypers3, doesntmatterperms and so on - doesn't cause Problems, as they are different Bitfields and those Names are just Shortcuts for the Bits :)

Mr Blunt
23 Aug 2005, 22:36
3 thumbs up for Kirby!!
Appreciate the time!!

Kirk Y
24 Aug 2005, 01:42
Yes. I've read this Post you made and found it very amusing :)

Ha ha... well I'm glad I can find ways to amuse you. I was just curious... not like you see v3 Arcade in the Navbar or anything, eh?

jesus likes pie
07 Oct 2005, 02:51
Can you make a specific user be allowed to use html?

If so, how?


EDIT: hey, I have an idea, could I make a secondary usergroup that has it enabled, put the desired user as secondary usergroup for it, but have him display as his primary one?

Will that work? If not.....what will?

sorry guys...wrong thread. rofl...

Andreas
07 Oct 2005, 02:52
Yes it will work, if the primary usergroup does allow membergroups.

Reaktor7
07 Oct 2005, 04:03
i am pretty sure there is a plugin for that which may make things a little neater....

harmor19
22 Oct 2005, 15:46
I got the same error someone else got about the escape strings

In the product I have I put that "Rebuild Bitfields" script Andreas wrote



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



I don't know if I plugins can be used without a hook so maybe that's my problem.

Here's my bitfield


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------

Andreas
22 Oct 2005, 22:00
You must use the Code as Product install Code.

harmor19
22 Oct 2005, 23:34
It was in a product but removed the plugin tags around it.

when I upload the product I get this error



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------

Andreas
23 Oct 2005, 01:01
Did you create the product XML by hand?
There is almost no chance the product manager would generate smth. like that ...

harmor19
23 Oct 2005, 01:19
Well I took references frommy other product xml's.

Thanks.

Now I'm on to update my testimonials mod.

Psionic Vision
28 Oct 2005, 23:32
Hi, this is the XML I'm trying to use:



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



On save, it says "Warning: mysql_real_escape_string() expects parameter 1 to be string, array given in /includes/class_core.php on line 635... why?

harmor19
28 Oct 2005, 23:36
download the xml's Andreas did for me and look off of those.

Psionic Vision
28 Oct 2005, 23:39
I don't see any difference other than the group used, and I don't think that's what causes the problem.

Ok, figured that I needed to rebuild bitfields.. But it still does not save.

Andreas
28 Oct 2005, 23:56
vbulletin, NOT vBulletin - better yet use your own product id.

Psionic Vision
29 Oct 2005, 00:06
I changed the product ID to my own. There are no results though.

As I said, after sumbitting the usergroup options, it says "usergroup X saved", but then after I reload the page, the option is back to "off" (as it was originally)... :( My latest XML:



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------

Andreas
29 Oct 2005, 00:17
Did you rebuild the bitfield cache?

Psionic Vision
29 Oct 2005, 00:18
Yes. Using the admincp navbar link in debug mode.

Figured: The problem was that I specified invalid decimal bitfield value. Now it is working (after I changed 0 to 1). :)

Mr Blunt
29 Oct 2005, 16:38
I don't think '' and '0' are valid bitfield values.

1st bitfield should have value of 1
2nd should have 2
3rd should have 4
4th should have 8
5th should have 16
and so on....

Psionic Vision
29 Oct 2005, 17:25
Yes, I already figured that, thanks.
It should be mentioned in the first post though.

Andreas
29 Oct 2005, 21:45
I assumed everybody knows how the binary system works ;)

Psionic Vision
29 Oct 2005, 22:12
Even if yes, it is not mentioned that XML uses binary data as the values. YOu did not specify what to put between the tags :)

Andreas
29 Oct 2005, 22:51
The value of <bitfield> is the decimal value of the bit (eg. 1 for the first, 2 for the second, 4 for the third, and so on).

So ... ?

Psionic Vision
29 Oct 2005, 22:59
Ah, I didn't see that :(

Alan @ CIT
10 Nov 2005, 11:22
I have a usergroup xml file with 3 bitfield options. How can I get them to be "Yes" by default when the product is installed?

At the moment, I've set the database column default to 7, then rebuild the bitfields, which makes them all appear as "Yes" when you edit a usergroup, but you need to go into each usergorup and click "Save" to make them take effect.

If you don't, they are still set as "No" in the forum, despite Usergroup Manager saying they are yes.

Any ideas?

Chris M
10 Nov 2005, 11:33
You can either run a manual query to update the bitfield values or you will have to save each Usergroup - There is no way to set it to a default value for existing usergroups since the datastore will not contain the values for the new settings ;)

Chris

Alan @ CIT
10 Nov 2005, 11:39
Dang, I was afraid of that. Cool, thanks Chris :)

sabret00the
18 Nov 2005, 14:38
thanks, very useful.

deathemperor
28 Nov 2005, 06:09
I found that the product attribute of the <bitfields> on vb3.5.0 is not case sensitive while 3.5.1 is

Mr Blunt
11 Dec 2005, 14:56
Untested, but



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------


Did this become broken in vb351 or vb352? For my hack, this code doesn't seem to allow the default install groups to be set during installation anymore (someone complained after installing it on vb3.5.2, which is when I tried the install/uninstall code again on my own test forum).

I spent the last 8 hours clicking around and found Andreas had a problem with his signature hack when vb351 came out, but since I didn't see the previous version, I don't know what he did to fix.

Sorry if this was answered elsewhere.

Andreas
11 Dec 2005, 15:26
Yep, that does not work any longer for 3.5.1+ as the bitfield builder ignores bitfields for non-active products.
You must adjust it a bit to just use the XMLReader.

Mr Blunt
12 Dec 2005, 01:43
Yep, that does not work any longer for 3.5.1+ as the bitfield builder ignores bitfields for non-active products.
You must adjust it a bit to just use the XMLReader.
Sigh, 12 hours of studying vb code and I haven't made any progress.

For the record, I gave up and moved the code to a seperate admin file and call it after installation.

Cheertobi
21 Dec 2005, 14:21
Hi,

I cannot get this work ;(

I made the following bitfield:



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



But $permissions['teampermissions'] seems to be empty and $vbulletin->bf_ugp_teampermissions['caneditteam']) or $vbulletin->bf_ugp_teampermissions['candeleteteams']) are always "true", even if they are selected in the admincp or not.

Tobi

Cheertobi
22 Dec 2005, 21:40
Does noone have an idea what is wrong in my coding?!

Andreas
23 Dec 2005, 22:13
Did you rebuild the bitfield cache?

@MrBlunt
Well, as said - just directly use the XMLReader and set your bits accordingly.
Or fake the product being installed and call the bitfield builder.

Cheertobi
23 Dec 2005, 23:44
Did you rebuild the bitfield cache?
Yes I did that. Andreas, can we maybe move over to vbhacks-germany? It might be easier for me to explain what I have done and what not work like expected in german?!

Regards,

Tobi

Andreas
24 Dec 2005, 00:30
If you already have a thread there or create on - sure

Delphiprogrammi
12 Jan 2006, 14:22
hi,

Thanks for your explanation verry usefull.One question through.My permissions show up fine the only thing that annoys me a little is that that little help icon that refuses to shoowup nexto my permissions ? i bet it got something todo with the adminhelp manager you see in debug mode ?

buh i hate XML most of the time i doesn't work for me



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



can't even choose between yes or no i can change it and vbulletin says options saved successfully but when i goback to check .... (you can guess)the value doesn't change



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



really hate XML :devious:

CyberRanger
17 Jan 2006, 18:52
posted in wrong thread ...

joefitz
07 Feb 2006, 03:18
Just an FYI, for those interested in having custom forum permissions that correspond with custom usergroup permissions, you may want to check out my hack discussed in the following thread:
Custom Usergroup Forum Permissions (http://www.vbulletin.org/forum/showthread.php?t=107342)

Andreas
07 Feb 2006, 03:29
There is a reason why there is no built-in support for custom forum permissions ;)

vasudeva
06 Apr 2006, 15:43
There is a reason why there is no built-in support for custom forum permissions ;)

What is that reason, for those of us new to the game? I'm trying to get my head around expanding vB's permissions system and would appreciate any insights.

Psionic Vision
25 Jun 2006, 20:55
I wonder why the "INSTALL" bit never works correctly. If I install such xml, all settings are initially off, regardless of install value.

andrefedalto
12 Jul 2006, 21:59
thanks Andreas for this nice custom usergroup permission howto...

i used to make my usergroup permissions with a plugin in the hook 'admin_usergroup_edit', but i needed 1 column in 'usergroup' table for each permission :( (too bad for lots of new perms)

but now this xml really rocks :)

Steve M
30 Jul 2006, 08:52
EDIT: Got it fixed

sabret00the
30 Jul 2006, 14:01
how do you check for INT Permissions?

rogersnm
08 Aug 2006, 10:17
So can you just do:

Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------


And then the query


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



To add a Yes/No?

harmor19
09 Aug 2006, 23:45
I couldn't get it to work so I made my own function in the hook "global_start".
I kept everything else the same but removed "can_administer".

I had to use this query to add the field to the "administrator" table.


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------




I put this in global_start


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



In your admin backend file I just used


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------

MaryTheG(r)eek
21 Oct 2006, 06:59
Very helpfull topic. Could you please extend it a bit saying me how I can set a default value per bitfield (for all usergroups) ?

I've the following code in bitfield_vbmates.xml


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



Then I setup correctly persmissions per user group. Why with the code:



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



a usergroup can go on while they dont have permission for it? Please note:
1.- I changed bitfield_vbmates.xml after the first product installation
2.- I've also trying to use in this file: <group name="vbmates_permissions"> but no chance.

Ok, I found it. It needed one couple of parenthesis more. Instead of:
if(!$permissions['vbmates'] & $vbulletin->bf_ugp['vbmates']['canadd'])
should be ...
if(!($permissions['vbmates'] & $vbulletin->bf_ugp['vbmates']['canadd']))

mrpaint
22 Oct 2006, 14:46
Hi, can you help me a bit in this problem?

My bitfield_get_direct_links.xml:


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



In UserGroupt Manager, it work well but in my php code, when I call

Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------


I can't find my get_direct_links_permissions. And when I call


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------


It is NULL

Can you help me? Thank you very much!

PS: Sorry for my bad English

Kungfu
05 Nov 2006, 20:37
I have some problems with an int bitfield.

<bitfield intperm="true" name="myhackintset" group="my_hack_permissions" phrase="myhack_int_desc"></bitfield>

Its baiscally like this one, only difference is it installs to all usergroups, including custom usergroups. Well my problem is this, i want to check if a person is in two usergroups, but one of the usergroups bitfield is set to 0. Example, Registered usergroup setting is 0, but Custom usergroup setting is 1. Instead of taking the 1 as the value, i need the 0.

Anyway to do this? Hope thats clear.

timetunnel
26 Nov 2006, 21:31
Hello.

How to change a custom bitfield_xx.xml parameter via vB Options?

For example, as I add new usergroups, I want to update the 'install' or 'ignore' param (e.g. comma-separated value) via ACP vs. editing the file.

Is that possible e.g. putting an ACP variable in the xml file?

Thanks in advance.

Update: Using a variable in the 'xml' file is not necessary but vB requires code revisions in order to update bitfield 'usergroups' via ACP vs. modifying 'bitfield_xx.xml' file. It may be better to work with the 'ignoregroups' feature in usergroups.php combined with vBulletin Options' User Profile Options instead of the 'install' parameter of the 'xml' file since 'ignoregroups' works in v.3.6.3 after installation whereas, it seems that the 'install' parameter of <bitfields> is only recognized during new installations.

Antivirus
19 Jan 2007, 19:52
Very useful info, thanks. I have permissions working properly for different usergroups within my hack, but I haven't been able to figure out how to put usergroup ids that have a certain setting into a string for use as a conditional query. For instance...

I have a y/n bitfield usergroup permission set up as:
$permissions['myhackperms'] & $vbulletin->bf_ugp_myhackperms['canfoo']

and I want to run a query on which users have bitfield 'canfoo' set to yes? regardless of what usergroup they're in.



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------


then after the result of this, i can put the usergroupids into a string and query which users are members of the usergroups in the string...

I know the query to get the usergroupids is wrong, it's due to me not knowing how to decode the bitfield, is there a function already written which vb uses to do these kinds of things? If so can someone point it out please?

Antivirus
28 Jan 2007, 03:15
figured it out, nevermind :)

Steve M
17 Jun 2007, 07:11
How would I call a permission in a template?

X Quiz
21 Jul 2007, 15:25
thanks, but how can I make my own permission for admin pages?

I mean to use:

if (!can_administer('XXXXXXXXXX'))
{
print_cp_no_permission();
}


XXXXXXXXXX = my permission



and then I can edit the permission from:
admincp/adminpermissions.php?do=modify

Delphiprogrammi
22 Jul 2007, 19:31
thanks, but how can I make my own permission for admin pages?

I mean to use:

if (!can_administer('XXXXXXXXXX'))
{
print_cp_no_permission();
}


XXXXXXXXXX = my permission



and then I can edit the permission from:
admincp/adminpermissions.php?do=modify

read this (http://www.vbulletin.org/forum/showthread.php?t=95918)

Nullifi3d
14 Oct 2007, 18:11
Apologies if this has already been asked and answered, but I need to adjust some permissions (upon product install) per usergroup so that some usergroups don't have access to certain features while others do. What would be the query for changing the permissions after the bitfield has been updated?

Blaine0002
07 Dec 2007, 19:23
ok the only question i have for this, is how do you check the permissions of a usergroup a certain user is in?

kainthedragoonx
01 Feb 2008, 18:41
I just want to say that this help is awesome! Thanks to you for creating it!


Just remember that the bit number needs to be in the XML or it will not save! Took me like ten minutes to realize that....

of course I am a noob!

Psionic Vision
10 Jun 2009, 15:01
So is there any way to create custom forum permissions without having to worry about future vBulletin bits?

Chani
21 Oct 2009, 19:12
Is this article still valid with 3.8.4? I'd rather know that before just jumping right into editing my database.

Neo_obs
30 Jan 2010, 00:20
How do I call an integer setting?

I have
<bitfield intperm="true" name="tunez_votes" group="tunez_perm" phrase="tunez_votes"></bitfield>

And I have the value set to 1 in the usergroup permissions page.

But I can't seem to call it, any ideas?

borbole
02 Jun 2010, 22:14
Thank you for this article. It helps me a lot with a mod that I will be creating soon.

Artistichaven
25 Apr 2011, 14:17
Does this work with 3.8.7, because it's not saving the value...

EquinoxWorld
29 Jun 2011, 16:56
Can this documentation be used with vb4? Is this still valid??

Cadellin
13 Aug 2011, 14:13
I've used it in vB4 and haven't found any issues or errors. If your doing something sensitive I would wait for a definitive answer though.