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);
}
Exemplo n.º 4
0
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);
}
Exemplo n.º 7
0
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);
}
Exemplo n.º 9
0
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);
}
Exemplo n.º 10
0
int DatabaseAuthorizer::allowAlterTable(const String&, const String& tableName)
{
    m_lastActionChangedDatabase = true;
    return denyBasedOnTableName(tableName);
}
Exemplo n.º 11
0
int DatabaseAuthorizer::createTempTable(const String& tableName)
{
    return denyBasedOnTableName(tableName);
}
Exemplo n.º 12
0
int DatabaseAuthorizer::allowAnalyze(const String& tableName)
{
    return denyBasedOnTableName(tableName);
}
Exemplo n.º 13
0
int DatabaseAuthorizer::allowRead(const String& tableName, const String&)
{
    return denyBasedOnTableName(tableName);
}
Exemplo n.º 14
0
int DatabaseAuthorizer::allowInsert(const String& tableName)
{
    m_lastActionChangedDatabase = true;
    m_lastActionWasInsert = true;
    return denyBasedOnTableName(tableName);
}
Exemplo n.º 15
0
int DatabaseAuthorizer::allowUpdate(const String& tableName, const String& columnName)
{
    m_lastActionChangedDatabase = true;
    return denyBasedOnTableName(tableName);
}
Exemplo n.º 16
0
int DatabaseAuthorizer::dropTempIndex(const String&, const String& tableName)
{
    return denyBasedOnTableName(tableName);
}
Exemplo n.º 17
0
int DatabaseAuthorizer::createTrigger(const String&, const String& tableName)
{
    m_lastActionChangedDatabase = true;
    return denyBasedOnTableName(tableName);
}
Exemplo n.º 18
0
int DatabaseAuthorizer::dropTempTrigger(const String& triggerName, const String& tableName)
{
    return denyBasedOnTableName(tableName);
}