How to use automatic permission checking on object access actions?

From 1.1 you can use very handy parameters in viewList variables. Let say you want to check does user has access to custom object with some id. So in module.php file all can look like this: $ViewList['editfile'] = array (
'script' => 'editfile.php',
'params' => array('file_id'),
'limitations' => array('self' => array('method' => 'erLhcoreClassFiles::modulePermision','param' => 'file_id'),'global' => array('edit_all')),
'functions' => array( 'editfile' )
);

How it works?

There are passed parameter file_id
Limitations does all the hard job. Limitations forces additional permission checking. To static erLhcoreClassFiles::modulePermision method is passed file_id parameter. After permission checking method returns false or object with file_id. If user has access to edit_all functions no permission checking is done via method call. If user does not have permission error is shown that user cannot edit current object, otherwise $Params['user_object'] consists of fetched object. Fetched object can be used for deletion actions of any other. Using this workflow you can speedup custom applications development even more.