KnowbaseItem::canViewItem PHP Method

canViewItem() public method

public canViewItem ( )
    function canViewItem()
    {
        global $CFG_GLPI;
        if ($this->fields['users_id'] == Session::getLoginUserID()) {
            return true;
        }
        if (Session::haveRight(self::$rightname, self::KNOWBASEADMIN)) {
            return true;
        }
        if ($this->fields["is_faq"]) {
            return Session::haveRightsOr(self::$rightname, array(READ, self::READFAQ)) && $this->haveVisibilityAccess() || Session::getLoginUserID() === false && $this->isPubliclyVisible();
        }
        return Session::haveRight(self::$rightname, READ) && $this->haveVisibilityAccess();
    }