SavedQuery: optional required_permission, in addition to sharing #3

Closed
opened 2026-10-26 08:20:20 +00:00 by Gilles · 0 comments
Owner

A host app (Argus, see argus/backend#17) may want a saved query's results gated behind an extra Django permission, on top of the existing owner/shared_users/shared_groups scoping -- e.g. a query that is visible (shared with a group) but whose actual data should only be computed for users who additionally hold some specific permission.

  • SavedQuery.required_permission (CharField, blank=True): a Django permission codename (app_label.codename), checked in addition to the existing rules
  • permissions.can_view_results: short-circuit to False when required_permission is set and the user lacks it (definition visibility via can_view_savedquery is unaffected -- this only gates results)
  • Expose/settable via the API (savedquery_collection/savedquery_detail) and in the Django admin
  • README: document the field and its interaction with the permission table

Label: feature.

A host app (Argus, see argus/backend#17) may want a saved query's *results* gated behind an extra Django permission, on top of the existing owner/shared_users/shared_groups scoping -- e.g. a query that is visible (shared with a group) but whose actual data should only be computed for users who additionally hold some specific permission. - [ ] `SavedQuery.required_permission` (CharField, blank=True): a Django permission codename (`app_label.codename`), checked in addition to the existing rules - [ ] `permissions.can_view_results`: short-circuit to False when `required_permission` is set and the user lacks it (definition visibility via `can_view_savedquery` is unaffected -- this only gates results) - [ ] Expose/settable via the API (`savedquery_collection`/`savedquery_detail`) and in the Django admin - [ ] README: document the field and its interaction with the permission table Label: feature.
Sign in to join this conversation.
No description provided.