Skip to content

LDEV-5705 remove per-datasource SQL restrictions - #3577

Merged
GianTschingt merged 1 commit into
lucee:9.0from
GianTschingt:LDEV-5705-remove-datasource-sql-restrictions
Nov 1, 2026
Merged

GianTschingt merged 1 commit into
lucee:9.0from
GianTschingt:LDEV-5705-remove-datasource-sql-restrictions

Conversation

@GianTschingt

Copy link
Copy Markdown
Contributor

Removes the per-datasource SQL restrictions (select, insert, update, delete, create, drop, revoke, grant, alter) from Lucee 9. They were deprecated and are no longer enforced; restrictions belong to the database user's roles and permissions.

Jira: https://luceeserver.atlassian.net/browse/LDEV-5705
Docs: lucee/lucee-docs#1648

Removed

  • the enforcement in QueryImpl, SimpleQuery and QueryLazy, and QueryUtil.checkSQLRestriction
  • the allow field and constructor/factory parameters in DataSourceSupport, DataSourceImpl, ApplicationDataSource, DataSourceFactory, ConfigAdmin, ConfigFactoryImpl
  • the "allowed" checkboxes in the datasource admin page, the allowed_* defaults in the dbdriver Driver.cfc, and the select/insert/... keys of admin action="getDatasource"
  • test/tickets/LDEV4485.cfc (skipped test that only covered the removed allow* import keys)

Kept for compatibility

  • DataSource.ALLOW_*, hasAllow(int) and hasSQLRestriction() stay in the loader API as @Deprecated; hasAllow always returns true, hasSQLRestriction always returns false
  • DataSourceDef.getAllowedSQL() returns all true
  • the allow / allow* config keys, the allow key of this.datasources, the allowed_* attributes of admin and the allowed* arguments of Administrator.updateDatasource() are accepted and ignored; a stored allow value is dropped when the datasource is updated

Tests

  • new test/tickets/LDEV5705.cfc (H2): create/insert/update/select/alter/delete/drop run against datasources configured with allow=0, allowed_*=false, a legacy allow bitmask and the legacy allow* keys; getDatasource no longer returns the flags. It fails on the previous code and passes with this change.
  • ran locally: LDEV5967, LDEV6066, LDEV6293, LDEV6296, LDEV6443, LDEV6553, LDEV6562, LDEV6567 (MySQL-only specs are skipped in this environment)

The select, insert, update, delete, create, drop, revoke, grant and alter
flags of a datasource are no longer enforced. Existing allow settings in
configs, Application.cfc, cfadmin and Administrator.cfc are accepted and
ignored. DataSource.ALLOW_* and the related methods remain in the loader as
deprecated no-ops.
@GianTschingt
GianTschingt merged commit db8d3e9 into lucee:9.0 Nov 1, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants