vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   How does Usergroup permission work? (https://vborg.vbsupport.ru/showthread.php?t=71258)

Marco van Herwaarden 01-21-2005 11:03 AM

Quote:

Originally Posted by KirbyDE
Best advice for usergroup permissions:
Don't extend existing bitfields!

Sooner or later this will cause problems.

Yes that is why i gave advice to create your own group.
Made that error on my first hack (never released), it was so easy to just extend an exisiting group. :D

Understood later that what might look easy to start with, could bring you into troubles later.

Unfortunatly i see most coders of smaller hacks just extend the existing ones.

rjordan 01-30-2005 06:00 PM

I have found this and other information useful. I thank all that have contributed. Now that I have my permissions set up and able to be modified via usergroup.php. My new problem is how to read the permissions and interpret their state. I have created a new field in the username table and the information is an on/off (Yes/No) option. How do I retrieve the permission state?

rjordan 01-31-2005 09:58 PM

Can anyone assist with this? It is the only piece I am having trouble grasping when it comes to assigning and checking permissions I think.

dwh 01-31-2005 10:13 PM

To access the new field, assuming the name of the new field is "newfield" you simply go $bbuserinfo[newfield]

rjordan 01-31-2005 10:42 PM

This does not return any value. The current value should be 1 and it is returning null. This new field is dealing with usergroup permissions... the same general permissions that you would check for "Can delete own posts" or "Can move own threads". If I hard-code a value of 1 to my variable, the script works correctly. I tried $canviewtwice = $usergroup[canviewtwice];, but that did not give a result either. canviewtwice is the name of the usergroup bitfield assignment.

EDIT: I found it. It was $permissions[canviewtwice]; that was needed. How stupid do I feel now? :o

Thanks, guys, for the assist. I am learning a LOT through this process thanks to you all!

dwh 01-31-2005 10:57 PM

I misunderstood the question but glad you figured it out.


All times are GMT. The time now is 02:31 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.01068 seconds
  • Memory Usage 1,727KB
  • 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_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete