int DatabaseAuthorizer::allowRead(const String& tableName, const String&) { if (m_permissions & NoAccessMask && m_securityEnabled) return SQLAuthDeny; return denyBasedOnTableName(tableName); }
int DatabaseAuthorizer::updateDeletesBasedOnTableName(const String& tableName) { int allow = denyBasedOnTableName(tableName); if (allow) m_hadDeletes = true; return allow; }
int DatabaseAuthorizer::allowUpdate(const String& tableName, const String&) { if (!allowWrite()) return SQLAuthDeny; m_lastActionChangedDatabase = true; return denyBasedOnTableName(tableName); }
int DatabaseAuthorizer::allowUpdate(const String& tableName, const String&) { if (m_readOnly && m_securityEnabled) return SQLAuthDeny; m_lastActionChangedDatabase = true; return denyBasedOnTableName(tableName); }
int DatabaseAuthorizer::createTempTrigger(const String&, const String& tableName) { // SQLITE_CREATE_TEMP_TRIGGER results in a INSERT operation, which is not // allowed in read-only transactions or private browsing, so we might as // well disallow SQLITE_CREATE_TEMP_TRIGGER in these cases if (!allowWrite()) return SQLAuthDeny; return denyBasedOnTableName(tableName); }
int DatabaseAuthorizer::createTempIndex(const String&, const String& tableName) { // SQLITE_CREATE_TEMP_INDEX should result in a UPDATE or INSERT operation, // which is not allowed in read-only transactions or private browsing, // so we might as well disallow SQLITE_CREATE_TEMP_INDEX in these cases if (!allowWrite()) return SQLAuthDeny; return denyBasedOnTableName(tableName); }
int DatabaseAuthorizer::createTempTable(const String& tableName) { // SQLITE_CREATE_TEMP_TABLE results in a UPDATE operation, which is not // allowed in read-only transactions or private browsing, so we might as // well disallow SQLITE_CREATE_TEMP_TABLE in these cases if (m_readOnly && m_securityEnabled) return SQLAuthDeny; return denyBasedOnTableName(tableName); }
int DatabaseAuthorizer::createVTable(const String& tableName, const String& moduleName) { if (!allowWrite()) return SQLAuthDeny; // Allow only the FTS3 extension if (!equalIgnoringCase(moduleName, "fts3")) return SQLAuthDeny; m_lastActionChangedDatabase = true; return denyBasedOnTableName(tableName); }
int DatabaseAuthorizer::createVTable(const String& tableName, const String& moduleName) { if (m_readOnly && m_securityEnabled) return SQLAuthDeny; // Allow only the FTS3 extension if (moduleName != "fts3") return SQLAuthDeny; m_lastActionChangedDatabase = true; return denyBasedOnTableName(tableName); }
int DatabaseAuthorizer::allowAlterTable(const String&, const String& tableName) { m_lastActionChangedDatabase = true; return denyBasedOnTableName(tableName); }
int DatabaseAuthorizer::createTempTable(const String& tableName) { return denyBasedOnTableName(tableName); }
int DatabaseAuthorizer::allowAnalyze(const String& tableName) { return denyBasedOnTableName(tableName); }
int DatabaseAuthorizer::allowRead(const String& tableName, const String&) { return denyBasedOnTableName(tableName); }
int DatabaseAuthorizer::allowInsert(const String& tableName) { m_lastActionChangedDatabase = true; m_lastActionWasInsert = true; return denyBasedOnTableName(tableName); }
int DatabaseAuthorizer::allowUpdate(const String& tableName, const String& columnName) { m_lastActionChangedDatabase = true; return denyBasedOnTableName(tableName); }
int DatabaseAuthorizer::dropTempIndex(const String&, const String& tableName) { return denyBasedOnTableName(tableName); }
int DatabaseAuthorizer::createTrigger(const String&, const String& tableName) { m_lastActionChangedDatabase = true; return denyBasedOnTableName(tableName); }
int DatabaseAuthorizer::dropTempTrigger(const String& triggerName, const String& tableName) { return denyBasedOnTableName(tableName); }