vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Forums and Groups permissions (https://vborg.vbsupport.ru/showthread.php?t=213076)

Ldoppea 05-07-2009 10:46 AM

Forums and Groups permissions
 
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 01:02 PM

Why not just look at the Forum Permissions page?

Ldoppea 05-07-2009 01:19 PM

I'm programming a plugin which display lasts messages. So I need to filter posts with forum permissions ;)

Lynne 05-07-2009 01: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 10:44 AM

Quote:

Originally Posted by Lynne (Post 1806395)
Why not look at the queries on the search page? They take user permissions into account.

Good idea :)

I found this :
PHP Code:

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


The existing permissions are :
Code:

[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 01: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 02: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 05: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 06:02 PM

Ok,

Thanks for your help ;)


All times are GMT. The time now is 10:35 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02241 seconds
  • Memory Usage 1,729KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (1)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete