mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-07 16:44:07 +01:00
Catch exception thrown when trying to instanciate a definition the user has no rights for, and discard it.
This commit is contained in:
parent
21c1f08322
commit
94c616bf12
@ -438,9 +438,14 @@ class importexport_helper_functions {
|
||||
$def = new importexport_definitions_bo(array('application'=>$appnames, 'type' => $types));
|
||||
$list = array();
|
||||
foreach((array)$def->get_definitions() as $id) {
|
||||
$definition = new importexport_definition($id);
|
||||
if($def->is_permitted($definition->get_record_array())) {
|
||||
$list[$definition->application][$definition->type] = $id;
|
||||
// Need to instanciate it to check, but if the user doesn't have permission, it throws an exception
|
||||
try {
|
||||
$definition = new importexport_definition($id);
|
||||
if($def->is_permitted($definition->get_record_array())) {
|
||||
$list[$definition->application][$definition->type] = $id;
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
// That one doesn't work, keep going
|
||||
}
|
||||
$definition = null;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user