static function currentUserHaveMoreRightThan($IDs = array())
{
global $DB;
if (Session::isCron()) {
return true;
}
if (count($IDs) == 0) {
// Check all profiles (means more right than all possible profiles)
return countElementsInTable('glpi_profiles') == countElementsInTable('glpi_profiles', self::getUnderActiveProfileRestrictRequest(''));
}
$under_profiles = array();
$query = "SELECT *\n FROM `glpi_profiles` " . self::getUnderActiveProfileRestrictRequest("WHERE");
$result = $DB->query($query);
while ($data = $DB->fetch_assoc($result)) {
$under_profiles[$data['id']] = $data['id'];
}
foreach ($IDs as $ID) {
if (!isset($under_profiles[$ID])) {
return false;
}
}
return true;
}