/** * Permanently deletes a node * * @param integer The nodeid of the record to be deleted * * @return boolean */ public function delete($nodeid) { $nodecontent = $this->getContent($nodeid); if (isset($nodecontent[$nodeid])) { $nodecontent = $nodecontent[$nodeid]; } else { throw new vB_Exception_Api('invalid_node_id'); } // Note: The library delete has a check to prevent top level channels from being deleted, but // that excludes channels like the root channel, or the special, privatemessage or vm channels. $guids = vB_Channel::getProtectedChannelGuids(); if (in_array($nodecontent['guid'], array_values($guids))) { throw new vB_Exception_Api('can_not_remove_default_channel'); } // the reason there is no permission check in this function is because the parent (vB_Api_Content) performs the checks return parent::delete($nodeid); }