Repository navigation
Conversation
spreadsheet.oca.revision had full CRUD for base.group_user and no record rule, so any internal user could read, create, change or delete the revisions of any spreadsheet or dashboard through RPC, regardless of the owner/contributor/reader rules of the document itself. Revisions now follow the record they belong to (model/res_id), as attachments and messages do: reading one requires read access to its spreadsheet, creating, changing or deleting one requires write access to it, and a revision can only point to a model inheriting spreadsheet.abstract. The ACL is unchanged, because dashboard viewers (plain internal users) read revisions when they open a dashboard. Also keep the import wizard private to its creator: transient records are not isolated per user in 18.0.
Transient records are not isolated per user in 18.0, so any internal user could read the "create dashboard from spreadsheet" wizards of the others. Add a creator rule, and tests showing that dashboard revisions follow the dashboard's access (viewers read, managers edit, hidden dashboards stay hidden).
Member
Author
|
@pedrobaeza Hi Pedro, I think the PR don't have any AI Atribution i can see. I used AI to fix this permission bug I found in production. Please tell me which part of the PR you think it's not okay and I modify it, I review the code before opening PRs but I automate a lot of CI / Tests with AI probably that's why you think it's AI slop. |
Member
|
You have to disclose the AI usage, and there's things that you already know that shouldn't be put in the PR, like the manifest version change. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #153.
spreadsheet.oca.revisionhas full CRUD forbase.group_userand no record rule, so anyinternal user can read, create, change or delete the revisions of any spreadsheet or
dashboard through RPC, whatever the document's own rules say.
With this PR revisions follow the document they belong to (
model/res_id), likeir.attachmentandmail.messagedo:spreadsheet.abstract;_searchadds one subquery per spreadsheet model (res_id in <readable documents>),_check_accesschecks the parent for the given records, andwritere-checks whenmodel/res_idchange. Superuser is untouched.I left the ACL on
base.group_useron purpose: dashboard viewers are plain internalusers and read the revisions of the dashboards they can see. Restricting the ACL to
spreadsheet_oca.group_userwould break that and still let a spreadsheet user readsheets they are not allowed to open.
Second commit: a creator rule on the two transient wizards
(
spreadsheet.spreadsheet.import,spreadsheet.to.dashboard), which in 18.0 arereadable across users.
Tests (failing on 18.0 before the change):
create, write or unlink;
revision;
record, is refused;
revisions stay hidden;
No migration needed: the change is code plus two record rules.
@OCA/spreadsheet-maintainers