public static function isAccessibleBy($document, $user)
    {
        $result = null;
        switch (Convertor::baseClassName($user)) {
            case 'User': //Admin
                $result = true;
                break;
            case 'Customer': //Customer
                $result = (self::getDocumentCompany($document) == self::getCustomerCompany($user));
                break;
            case 'Anonym': //Anonymous
                $result = false;
                break;
        }
        return $result;
    }
public static function isAccessibleBy($document, $user)
    {
        $result = null;
        switch (Convertor::baseClassName($user)) {
            case 'User': //Admin
                $result = true;
                break;
            case 'Customer': //Customer
                $result = (self::getDocumentCompany($document) == self::getCustomerCompany($user));
                break;
            case 'Anonym': //Anonymous
                $result = false;
                break;
        }
        return $result;
    }
public static function isAccessibleBy ( $ document , $ user ) { $ result = null ; switch ( Convertor :: baseClassName ( $ user ) ) { case 'User' : //Admin $ result = true ; break ; case 'Customer' : //Customer $ result = ( self :: getDocumentCompany ( $ document ) == self :: getCustomerCompany ( $ user ) ) ; break ; case 'Anonym' : //Anonymous $ result = false ; break ; } return $ result ; }
Is document accessible by user ?

@param \FlexiPeeHP\FlexiBeeRO $document FlexiBee documnet
@param Customer|User|\Ease\Anonym $user Current User

@return boolean
Is document accessible by user ?