PDA

View Full Version : Forums and Groups permissions


Ldoppea
05-07-2009, 11:46 AM
Hi,

I'm trying to access Forums and Groups permission. For example, I have an user group ID and a forum ID, and I need to know if this user group can view the forum or if he can view threads.

I know that forum permissions are in the vb_forumpermission table, but I don't know how to interprete the value.

Thanks.

Lynne
05-07-2009, 02:02 PM
Why not just look at the Forum Permissions page?

Ldoppea
05-07-2009, 02:19 PM
I'm programming a plugin which display lasts messages. So I need to filter posts with forum permissions ;)

Lynne
05-07-2009, 02:34 PM
So you are displaying posts somewhere and you want to make sure that only the posts the user has permission to see get shown? Why not look at the queries on the search page? They take user permissions into account.

Ldoppea
05-08-2009, 11:44 AM
Why not look at the queries on the search page? They take user permissions into account.

Good idea :)

I found this :
if($vbulletin->userinfo['forumpermissions']["$forumid"] & $vbulletin->bf_ugp_forumpermissions['canview'])


The existing permissions are :
[bf_ugp_forumpermissions] => Array
(
[canview] => 1
[canviewothers] => 2
[cansearch] => 4
[canemail] => 8
[canpostnew] => 16
[canreplyown] => 32
[canreplyothers] => 64
[caneditpost] => 128
[candeletepost] => 256
[candeletethread] => 512
[canopenclose] => 1024
[canmove] => 2048
[cangetattachment] => 4096
[canpostattachment] => 8192
[canpostpoll] => 16384
[canvote] => 32768
[canthreadrate] => 65536
[followforummoderation] => 131072
[canseedelnotice] => 262144
[canviewthreads] => 524288
[cantagown] => 1048576
[cantagothers] => 2097152
[candeletetagown] => 4194304
[canseethumbnails] => 8388608
)


Do you know where are defined this values?

Lynne
05-08-2009, 02:54 PM
Do you mean where are they actually defined (I believe they are defined in the usergroup manager) or do you mean what are they (like 'canratethread' means you may rate a thread)?

Ldoppea
05-08-2009, 03:53 PM
My question is : Are they defined in the database? In a php file? For example : where is the value 64 assigned to canreplyothers?

Lynne
05-08-2009, 06:00 PM
They are defined in the admin cp when you do a save. You can see the bitfields defined in /includes/xml/bitfield_vbulletin.xml

Ldoppea
05-08-2009, 07:02 PM
Ok,

Thanks for your help ;)