Hi to all,

I have to share one very useful piece of code, since I was looking for this feature for a long time ago.
I have to thank to mvngti (Marnus van Niekerk) for pointing me to the right direction.

If you want to allow/disallow editing/removing records from the subpanel from the detailed view of the record, you can use following:

if (!ACLController::checkAccess(my_module_folder_name , edit, false, 'module')) {
$subpanel_layout['top_buttons'] = array();
unset ($subpanel_layout['list_fields']['edit_button']);
}

In this example:
- we are checking whether the user has edit permission, and removing edit_button if he/she does not have it. Also, top buttons are removed.
- where my_module_folder_name is the module folder name of the record which detailed view is currently viewed
-we have to define role to which current user will belong and assign appropriate permission

Igor