Index: trunk/core/units/custom_fields/custom_fields_event_handler.php =================================================================== diff -u -N -r4380 -r4670 --- trunk/core/units/custom_fields/custom_fields_event_handler.php (.../custom_fields_event_handler.php) (revision 4380) +++ trunk/core/units/custom_fields/custom_fields_event_handler.php (.../custom_fields_event_handler.php) (revision 4670) @@ -2,6 +2,25 @@ class CustomFieldsEventHandler extends InpDBEventHandler { /** + * Changes permission section to one from REQUEST, not from config + * + * @param kEvent $event + */ + function CheckPermission(&$event) + { + $sql = 'SELECT Prefix + FROM '.TABLE_PREFIX.'ItemTypes + WHERE ItemType = '.$this->Conn->qstr( $this->Application->GetVar('cf_type') ); + $main_prefix = $this->Conn->GetOne($sql); + + $section = $this->Application->getUnitOption($main_prefix.'.custom', 'PermSection'); + $event->setEventParam('PermSection', $section); + return parent::CheckPermission($event); + + + } + + /** * Apply any custom changes to list's sql query * * @param kEvent $event