| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 337 | 337 |
| 338 int DatabaseAuthorizer::allowTransaction() | 338 int DatabaseAuthorizer::allowTransaction() |
| 339 { | 339 { |
| 340 return m_securityEnabled ? SQLAuthDeny : SQLAuthAllow; | 340 return m_securityEnabled ? SQLAuthDeny : SQLAuthAllow; |
| 341 } | 341 } |
| 342 | 342 |
| 343 int DatabaseAuthorizer::allowRead(const String& tableName, const String&) | 343 int DatabaseAuthorizer::allowRead(const String& tableName, const String&) |
| 344 { | 344 { |
| 345 if (m_permissions & NoAccessMask && m_securityEnabled) | 345 if (m_permissions & NoAccessMask && m_securityEnabled) |
| 346 return SQLAuthDeny; | 346 return SQLAuthDeny; |
| 347 | 347 |
| 348 return denyBasedOnTableName(tableName); | 348 return denyBasedOnTableName(tableName); |
| 349 } | 349 } |
| 350 | 350 |
| 351 int DatabaseAuthorizer::allowReindex(const String&) | 351 int DatabaseAuthorizer::allowReindex(const String&) |
| 352 { | 352 { |
| 353 return (!allowWrite() ? SQLAuthDeny : SQLAuthAllow); | 353 return (!allowWrite() ? SQLAuthDeny : SQLAuthAllow); |
| 354 } | 354 } |
| 355 | 355 |
| 356 int DatabaseAuthorizer::allowAnalyze(const String& tableName) | 356 int DatabaseAuthorizer::allowAnalyze(const String& tableName) |
| 357 { | 357 { |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 393 | 393 |
| 394 bool DatabaseAuthorizer::allowWrite() | 394 bool DatabaseAuthorizer::allowWrite() |
| 395 { | 395 { |
| 396 return !(m_securityEnabled && (m_permissions & ReadOnlyMask || m_permissions
& NoAccessMask)); | 396 return !(m_securityEnabled && (m_permissions & ReadOnlyMask || m_permissions
& NoAccessMask)); |
| 397 } | 397 } |
| 398 | 398 |
| 399 void DatabaseAuthorizer::setReadOnly() | 399 void DatabaseAuthorizer::setReadOnly() |
| 400 { | 400 { |
| 401 m_permissions |= ReadOnlyMask; | 401 m_permissions |= ReadOnlyMask; |
| 402 } | 402 } |
| 403 | 403 |
| 404 void DatabaseAuthorizer::setPermissions(int permissions) | 404 void DatabaseAuthorizer::setPermissions(int permissions) |
| 405 { | 405 { |
| 406 m_permissions = permissions; | 406 m_permissions = permissions; |
| 407 } | 407 } |
| 408 | 408 |
| 409 int DatabaseAuthorizer::denyBasedOnTableName(const String& tableName) const | 409 int DatabaseAuthorizer::denyBasedOnTableName(const String& tableName) const |
| 410 { | 410 { |
| 411 if (!m_securityEnabled) | 411 if (!m_securityEnabled) |
| 412 return SQLAuthAllow; | 412 return SQLAuthAllow; |
| 413 | 413 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 425 | 425 |
| 426 int DatabaseAuthorizer::updateDeletesBasedOnTableName(const String& tableName) | 426 int DatabaseAuthorizer::updateDeletesBasedOnTableName(const String& tableName) |
| 427 { | 427 { |
| 428 int allow = denyBasedOnTableName(tableName); | 428 int allow = denyBasedOnTableName(tableName); |
| 429 if (allow) | 429 if (allow) |
| 430 m_hadDeletes = true; | 430 m_hadDeletes = true; |
| 431 return allow; | 431 return allow; |
| 432 } | 432 } |
| 433 | 433 |
| 434 } // namespace WebCore | 434 } // namespace WebCore |
| OLD | NEW |