CommonDBTM::check PHP Method

check() public method

Check right on an item with block
public check ( $ID, $right, array &$input = NULL ) : nothing
$ID ID of the item (-1 if new item)
$right Right to check : r / w / recursive
$input array
return nothing
    function check($ID, $right, array &$input = NULL)
    {
        global $CFG_GLPI;
        // Check item exists
        if (!$this->isNewID($ID) && (!isset($this->fields['id']) || $this->fields['id'] != $ID) && !$this->getFromDB($ID)) {
            // Gestion timeout session
            Session::redirectIfNotLoggedIn();
            Html::displayNotFoundError();
        } else {
            if (!$this->can($ID, $right, $input)) {
                // Gestion timeout session
                Session::redirectIfNotLoggedIn();
                Html::displayRightError();
            }
        }
    }
CommonDBTM