Commit Graph
16 Commits
Author SHA1 Message Date
Herculino Trotta 18d4ab7d11 fix(rules): enforce object-level authorization on rule endpoints
SharedObjectManager scopes querysets to what a user may see, which
includes other people's public and shared-with-them objects. Several
mutating rule endpoints treated that visibility as permission to write.

Generalise get_owned_object_or_403 into get_shared_object_or_error, which
takes an explicit access level instead of inferring one:

- READ requires the object to be visible; denial is 404 so the response
  does not confirm that an id exists.
- EDIT requires ownership; denial is 403, but only after the visibility
  check, so 403 never leaks the existence of an invisible object. This
  matters for TransactionRuleAction, whose manager is unscoped.

The previous owner_path resolved to a User and discarded the object, so
it could not express visibility at all. via= now points at the governing
SharedObject and is resolved with a plain getattr, so an unresolvable
path raises instead of silently granting access.

is_visible_to/is_editable_by replace is_accessible_by, which was never
called and tested visibility == "shared", a value that does not exist in
Visibility.

Also fixes two further holes in the same module:

- transaction_rule_delete fell through to delete() whenever the caller
  was not in shared_with, so any user could delete a public rule. Now
  only the owner deletes; a shared user revokes their own access.
- transaction_rule_view was read-only but is now explicitly READ, so
  rules shared with a user stay viewable.

The activate/deactivate control is hidden for rules the user does not
own, instead of rendering a button that always fails.

Refs GHSA-83g9-vjqf-2j5q
2026-09-01 21:25:46 -03:00
Herculino Trotta c168886968 feat: improve text for rules 2025-12-14 11:42:51 -03:00
Herculino Trotta b38ed37bc5 feat: oh look, more changes 2025-11-10 00:28:16 -03:00
Herculino Trotta 7e37948616 feat: more changes and fixes 2025-11-09 15:31:50 -03:00
Herculino Trotta 9ade58a003 feat: another batch 2025-11-03 01:40:13 -03:00
Herculino Trotta a63367a772 feat: first batch of work 2025-11-01 03:15:44 -03:00
Herculino Trotta e600d87968 feat: automated replacement 2025-10-28 14:13:30 -03:00
Herculino Trotta d724300513 changes 2025-09-02 15:54:45 -03:00
Herculino Trotta b4e9446cf6 chore: update tailwind to v4
As is customary in the JS world EVERYTHING must break with each major version
2025-06-21 16:12:44 -03:00
Herculino Trotta 020dd74f80 feat: multi tenancy support 2025-03-08 12:03:17 -03:00
Herculino Trotta 3bcac31495 feat: add soft search to config pages 2024-12-01 12:15:56 -03:00
Herculino Trotta 28c8a961bc feat: use proper cotton boolean for removing padding on empty msg 2024-11-30 17:12:12 -03:00
Herculino Trotta 395578e558 feat: add empty message for all management pages 2024-11-04 21:44:06 -03:00
Herculino Trotta 3d4b67e5b0 refactor: remove empty _hyperscript tags 2024-11-04 00:10:02 -03:00
Herculino Trotta be76ccfdf6 feat: improve config pages listings 2024-10-27 21:55:32 -03:00
Herculino Trotta b9a9e279dc feat: add rules for transactions 2024-10-23 00:39:14 -03:00