Implement safety-net when saving or deleting a homebox

Created on 8 April 2024, 3 months ago
Updated 11 April 2024, 3 months ago

Problem/Motivation

Homebox is quite complex due to the many levels of permissions and especially cloning of the presets to instances.

To ensure nothing really bad can happen finally, we should implement a safety-net in

  • save() (is called on create and update, I assume)
  • delete() (is called on delete)

In these, I'd say we should implement Exception-driven permission checks, for example:

  • If preset, it should only be saved / deleted, if the user has the appropriate PRESET permission (administer presets)
  • If instance and not owned by the user, should only be saved / deleted, if the user has the appropriate ANY permission (or bypass homebox access control?)

This might not be perfect architecture, but should be seen as "last resource ass-saver" ;) ;D (sorry) if all other hurdles should break.

Background: I'm afraid of edge-cases where a user might get passed a wrong (preset or other user) instance.

Can we have simple (programmatic?) tests to ensure these exceptions work as expected eventually?

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

πŸ“Œ Task
Status

Postponed

Version

3.0

Component

Code

Created by

πŸ‡©πŸ‡ͺGermany Anybody Porta Westfalica

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024