Skip to content

dbeaver/pro#8234 only admin can overwrite existing udbt handler - #4285

Open
HocKu7 wants to merge 12 commits into
develfrom
dbeaver/pro#8234-udbt-only-for-admins
Open

dbeaver/pro#8234 only admin can overwrite existing udbt handler#4285
HocKu7 wants to merge 12 commits into
develfrom
dbeaver/pro#8234-udbt-only-for-admins

Conversation

@HocKu7

@HocKu7 HocKu7 commented Apr 15, 2026

Copy link
Copy Markdown
Contributor

@codacy-production

codacy-production Bot commented Apr 15, 2026

Copy link
Copy Markdown

Not up to standards ⛔

🔴 Issues 1 minor

Alerts:
⚠ 1 issue (≤ 0 issues of at least minor severity)

Results:
1 new issue

Category Results
Documentation 1 minor

View in Codacy

🟢 Metrics 2 duplication

Metric Results
Duplication 2

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

HocKu7 and others added 5 commits April 20, 2026 11:46
…dmins' into dbeaver/pro#8234-udbt-only-for-admins

# Conflicts:
#	server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/model/rm/local/BaseLocalResourceController.java
#	server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/model/rm/local/LocalResourceController.java

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

There are correctness/robustness issues in the updated validation flow (redundant/ineffective pre-validation and a potential null stored-configuration passed into validation) that should be resolved before merge.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR tightens server-side permission enforcement around network handler configuration changes so that only appropriately privileged users (e.g., admins) can overwrite existing handler settings when updating connections or importing/updating project data source configurations.

Changes:

  • Pass a permission realm into connection configuration application so handler descriptors are resolved with permission checks.
  • Add validation of network handler configuration updates against the previous (stored) configuration during data source updates and RM project config updates.
  • Extend BaseWebProjectImpl with project-aware hasRealmPermission evaluation to support per-project permissions.
File summaries
File Description
server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/WebConnectionConfigInputHandler.java Adds permission-aware configuration application and validates handler updates during datasource update/create.
server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/utils/WebDataSourceUtils.java Introduces permission-realm overload and enforces permission checks when configuring network handlers.
server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/model/rm/local/LocalResourceController.java Captures prior configs and validates handler changes after loading updated datasource/network profile configs.
server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/model/rm/local/BaseLocalResourceController.java Adds hooks to capture/validate stored configs and refreshes registry on load failures.
server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/BaseWebProjectImpl.java Implements project-aware realm permission checks (workspace + project permissions).
Review details
  • Files reviewed: 5/5 changed files
  • Comments generated: 2
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +72 to +83
DBPConnectionConfiguration storedConfiguration = new DBPConnectionConfiguration(
dataSource.getConnectionConfiguration()
);
DBPConnectionConfiguration updatedConfiguration = new DBPConnectionConfiguration(storedConfiguration);
WebDataSourceUtils.setConnectionConfiguration(
dataSource.getDriver(),
updatedConfiguration,
input,
registry.getProject()
);
validateHandlerConfigurationUpdate(storedConfiguration, updatedConfiguration);

continue;
}

DBPConnectionConfiguration storedConfiguration = storedDataSourceConfigurations.get(dataSource.getId());
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.

3 participants