Repository navigation
fix: Show the pgTimeTable Chains node only to roles with INSERT, SELECT and UPDATE on timetable.chain - #10698
adityaanikam wants to merge 1 commit into
Conversation
…d UPDATE on timetable.chain. pgadmin-org#10695
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Require all table privileges web/pgadmin/browser/server_groups/servers/pg_timetable/__init__.py, web/pgadmin/browser/server_groups/servers/pg_timetable/tests/utils.py |
The backend visibility check and installation test use separate privilege checks for INSERT, SELECT, and UPDATE. Both require all three checks to pass. |
Priority:
Estimated code review effort: 2 (Simple) | ~5 minutes
Change: Bug fix · Severity of issue fixed: Medium
Suggested reviewers: robe2
Merge Risk: 
Minimal · up to 09a71
-
No actionable merge-blocking risk remains from this change.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passed-
Full details: Linked Issues check
-
Explanation
The direct issue
#10695requires the Chains node to appear only when the role has INSERT, SELECT, and UPDATE on timetable.chain, or requires a separate read-only design. The PR uses the first option. In ChainModule.backend_supported, three separate has_table_privilege calls are combined with AND. The test helper uses the same all-privileges check. This prevents a role with only one listed privilege from passing the node visibility check.
-
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 2 functions across 2 files.
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
-
Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands.
|
Thanks! Squashed and merged as e53dc9e. |
Fixes #10695.
has_table_privilege('timetable.chain', 'INSERT, SELECT, UPDATE')is true when the role holds any one of the listed privileges, so a SELECT-only role saw the pgTimeTable Chains node and its create/edit menus, and every save failed with HTTP 500. The check now requires all three. The same query in the test helperis_pgtimetable_installed_on_serveris updated to match.Tested on PostgreSQL 17 with a
timetable.chaintable and four roles: the old check returns true for SELECT-only and INSERT-only roles, the new one returns true only for the role with all three privileges. pycodestyle passes on both files.Summary by CodeRabbit