[FIX] dms: User with no access cannot CRUD #533
All Vouch review confidence checks passed
Residual risk 0.13 = Change Risk (0.38) × (1 − Review Confidence (0.65)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.38 · 134 lines diff across 5 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.47 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.293
Real PR Conversation Timeline
1 comments
"Review active on #533"
general
weight: 0.35
OCA-git-bot
SirPyTech
During the migration to
18.0(https://github.com/OCA/dms/commit/1f08ada7270f879d81a26f66b1676cca5406c0e9) the override ofdms.security.mixin._filter_access_rules_pythonwas somehow substituted by a fewfilteredmethods that all try to keep the old behavior: use SQL and the search overrides to apply the directory permissions instead of Python code.Among others, this override was added:
Despite the explanation and the reference, I think this makes little sense simply because when filtering with
sudo, thedomainis not used.This causes the failure of the use-case in the added test: if a user has no access to a directory, for them the directory's permission fields are all
False.Before this change, the test fails with
<pre>
ERROR devel odoo.addons.dms.tests.test_directory: FAIL: DirectoryTestCaseBase.test_user_no_permission
Traceback (most recent call last):
File "/opt/odoo/auto/addons/dms/tests/test_directory.py", line 299, in test_user_no_permission
self.assertFalse(directory.permission_read)
AssertionError: True is not false
</pre>