New "debug" event permission

1 view
Skip to first unread message

Alexander Obuhovich

unread,
May 18, 2010, 8:43:14 AM5/18/10
to In-Portal Development
All events, that are executed based on user form submit are checked against permission, that allows to execute them. Mapping between events and their permissions is defined in "mapPermissions" method of event handler, that holds event implementation.

Recently I came across need to make several events to be allowed for execution not based on user group-based permission, but simply when debug mode is on.

To use it you need to use "debug" keyword in permission mapping instead "add"/"edit" etc. e.g.:

function mapPermissions()
{
    parent::mapPermissions();

    $permissions = Array (
        'OnMassDelete' => Array ('self' => 'debug'),
    );

    $this->permMapping = array_merge($this->permMapping, $permissions);
}

Task: http://tracker.in-portal.org/view.php?id=736

--
Best Regards,

http://www.in-portal.com
http://www.alex-time.com
debug_permission_name_for_events.patch
Reply all
Reply to author
Forward
0 new messages