dartho
04-30-2009, 06:59 AM
I want to override permissions using a plugin - specifically for viewing attachments. By default, guests can not view attachments. I know I can set this manually, but would like to do so dynamically.
I think this is the bitfield I need to toggle is:
<bitfields product="vbulletin">
<bitfielddefs>
<group name="ugp">
<group name="forumpermissions">
<bitfield name="cangetattachment" group="forum_viewing_permissions" phrase="can_download_attachments" install="2,5,6,7" >4096</bitfield>
I've tried creating a plugin on various hooks with the code:
$userdata->set_bitfield('forumpermissions','cangetattachment' ,true);
I'm yet to get this working.
the plugin code will have other conditionals (primarily the forum which the post/attachment resides in ), but the short story is I ultimately want to allow viewing of attachments by anyone.
any help appreciated !
Many thanks
I think this is the bitfield I need to toggle is:
<bitfields product="vbulletin">
<bitfielddefs>
<group name="ugp">
<group name="forumpermissions">
<bitfield name="cangetattachment" group="forum_viewing_permissions" phrase="can_download_attachments" install="2,5,6,7" >4096</bitfield>
I've tried creating a plugin on various hooks with the code:
$userdata->set_bitfield('forumpermissions','cangetattachment' ,true);
I'm yet to get this working.
the plugin code will have other conditionals (primarily the forum which the post/attachment resides in ), but the short story is I ultimately want to allow viewing of attachments by anyone.
any help appreciated !
Many thanks